There is a workaround on the internet as follows:
Http://www.cnblogs.com/stone_w/archive/2012/10/25/2738345.html
But I tried. It's too much trouble, and once the EF is rebuilt and rebuilt.
Later I queried the information, can use the T4 template to solve this problem.
1. Download file getsummery.ttinclude, here I have provided, everyone to download: download
2. Unzip the files we downloaded and put the extracted files into the solution3. Modify the following
app.config
, add a connection string:
- <add name= "myconn" connectionstring= "data source=.; Initial catalog=db;user id=sa;password=xxx; " providername="System.Data.SqlClient" />
4. Modifications
model.tt
, add code at the top location:
- <#@ include file="getsummery.ttinclude" #>
5. (Insert class Comment, optionally add) insert above code fragment <#=codeStringGenerator.EntityClassOpening(entity)#>
(around 28 lines)
- <summary>
- <#= gettablesummery (code. Escape (Entity) #>
- </Summary>
6. (add field comment) in code snippet:
<#=codeStringGenerator.Property(edmProperty)#>
Above (76 rows or so) Insert:
- <summary>
- <#= getcolumnsummery (code. Escape (entity), code. Escape (edmproperty) #>
- </Summary>
Note: The previous comment symbol///cannot be less
Here, basically done, to refresh your entity model EDMX file, you will find the field comments are automatically added.
Reference Source Address: http://jeffblog.sinaapp.com/archives/501
Add database entity annotations for the EF framework using the T4 template