Skip to content

Instantly share code, notes, and snippets.

@timabell
Created January 16, 2015 19:46
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save timabell/74bb6c6bbb7a4de843dc to your computer and use it in GitHub Desktop.
Save timabell/74bb6c6bbb7a4de843dc to your computer and use it in GitHub Desktop.
t4 snippet for adding xml doc from .edmx
// 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