3

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 not a deal breaker in our decision - but it would be nice.

Thanks for any advice

Aaron.

Aaron
  • 33
  • 2
  • Yes of course - you can tap into the T4 code generation templates and fill in something meaningful into your summary ! – marc_s May 05 '11 at 16:04
  • Related: [How can I make the Entity data model designer use my database column descriptions?](http://stackoverflow.com/questions/2747788/how-can-i-make-the-entity-data-model-designer-use-my-database-column-descriptions) – Daniel Ballinger Jul 27 '11 at 21:56

1 Answers1

2

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.

Ladislav Mrnka
  • 360,892
  • 59
  • 660
  • 670