How can I make the Entity data model designer use my database column descriptions?

前端 未结 3 1614
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 16:43

I am using EF4 with Visual Studio 2010. I have a SQL database already created and all my columns are documented with the Description property in SQL management studio. When

3条回答
  •  星月不相逢
    2020-12-09 17:07

    I've been looking at ways of hacking something together to populate the edmx with the meta data from the database.

    The summary and long description edmx properties are stored in elements under the EntityType element.

    
        
        
                Entity Summary
                Entity Long Description
              
        
          
        
        
        
      
    

    The relevant section of the edmx file, the Store Schema Definition Language (SSDL), is created by System.Data.Entity.Design.EntityStoreSchemaGenerator.GenerateStoreMetadata(). Or at least this is the case with EdmGen.

    I'm going to see if the EntityStoreSchemaGenerator.StoreItemCollection can be modified before being used by EntityStoreSchemaGenerator.WriteStoreSchema(...) to output the XML.

    Update

    Well that was annoying. System.Data.Metadata.Edm.Documentation is sealed and only has an internal constructor. Both properties of interest can only be set internally as well. So it seems like a dead end approach.

提交回复
热议问题