Add XML documentation / comments to properties/fields in EF generated classes

As Ladislav stated in his answer, you need to modify the T4 template so the comments will be included in the generated code. This answer was taken from this article:

First of all you need to specify your comments in the properties boxes of the model designer. Under Documentation -> Long Description, and Summary.

Then in the template, you can for example add this above the property you want to document:

<#if (!ReferenceEquals(edmProperty.Documentation, null))
{
#>
/// <summary>
/// <#=edmProperty.Documentation.Summary#> – <#=edmProperty.Documentation.LongDescription#>
/// </summary>
<#}#>

This will create a summary block above your property in the generated code.


No. You will have to modify your T4 template used to generate classes (or create new custom tool for class generation) to make these comments for you.