Skip to content

Instantly share code, notes, and snippets.

@hunt3ri
Created September 19, 2012 21:43
Show Gist options
  • Save hunt3ri/3752484 to your computer and use it in GitHub Desktop.
Save hunt3ri/3752484 to your computer and use it in GitHub Desktop.
Get summary block from each API method
/// <summary>
/// Read the Summary block from each API method, grab the entire XML fragment as we'll use a series of
/// Extension methods on APIExplorer to parse the XML for output later.
/// </summary>
public virtual string GetDocumentation(HttpActionDescriptor actionDescriptor)
{
var memberNode = GetMemberNode(actionDescriptor);
if (memberNode != null)
{
var summaryNode = memberNode.SelectSingleNode("summary");
if (summaryNode != null)
{
return summaryNode.OuterXml;
}
}
return "No Documentation Found.";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment