Created
January 16, 2015 19:46
-
-
Save timabell/74bb6c6bbb7a4de843dc to your computer and use it in GitHub Desktop.
t4 snippet for adding xml doc from .edmx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// heavily modified version of http://forums.asp.net/t/2011994.aspx | |
... | |
WriteLine(""); | |
WriteDocumentation(entity.Documentation);#> | |
... | |
WriteDocumentation(edmProperty.Documentation, CurrentIndent); | |
... | |
WriteDocumentation(complexProperty.Documentation); | |
... | |
WriteDocumentation(navigationProperty.Documentation); | |
... | |
public void WriteDocumentation(Documentation documentation, string indent = "") | |
{ | |
if(documentation != null && !string.IsNullOrEmpty(documentation.Summary)) | |
{ | |
WriteLine(indent + "/// <summary>"); | |
WriteLine(indent + "/// " + documentation.Summary); | |
WriteLine(indent + "/// </summary>"); | |
if(!string.IsNullOrEmpty(documentation.LongDescription)) | |
{ | |
WriteLine(indent + "/// <remarks>"); | |
WriteLine(indent + "/// " + documentation.LongDescription); | |
WriteLine(indent + "/// </remarks>"); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment