Search code examples
c#t4mdf

Get column description from mdf file in CSharpDbContext.Types.tt


I'm modifying CSharpDbContext.Types.tt file.

I want to use column description as comment of fields in entity class.

I'd to ask how to get description of columns from mdf file and then set to EdmProperty.Documentation in CSharpDbContext.Types.tt file.

https://i.sstatic.net/yOZuF.png


Solution

  • After searching for a long day, I have found a solution

    1. Generate entity documentation from table/column description.

    https://marketplace.visualstudio.com/items?itemName=mthamil.EntityDesignerDocumentationGenerator

    1. Generate comment from entity documentation.

    https://stackoverflow.com/a/14149605/2608958