开发者

Can the ///summary be auto filled by SQL Server descriptions in EF4 Entities?

开发者 https://www.devze.com 2023-03-02 21:47 出处:网络
Our company is in the middle of evaluating a couple of different ORMs and we are currently looking at the EF4 side of things.

Our company is in the middle of evaluating a couple of different ORMs and we are currently looking at the EF4 side of things. I have a small question that I hope someone here can answer... In our generated EntityDataModel.Designer.cs file all our Entity classes (and the properties within them) have a ///summary with the sentence "No Metadata Documentation available".

Is there any way to have these picked up from the Description Property on the columns from SQL Server?

I can see there is a documentation property within the edmx file but they are all blank. Obviously its 开发者_JAVA百科not a deal breaker in our decision - but it would be nice.

Thanks for any advice

Aaron.


Yes, documentation properties are blank in EDMX because you must fill them yourselves. EF doesn't load columns descriptions defined in SQL Server.

These columns descriptions are stored in sys.extended_properties and have MS_Description as a name. Theoretically you can modify T4 template (EFv4) to load descriptions for columns and create comments but it would be a lot of work to do. You will have to:

  • for each scalar property you will have to search metadata to get column and table name and query DB to get a description

That is a lot of work and having T4 template opening connection to database is very uncommon.

0

精彩评论

暂无评论...
验证码 换一张
取 消