What populates the Webapi
method's description on the helper page and the introduction paragraph?
What populates the Webapi
method's description on the helper page and the introduction paragraph?
According to this article you can use XML documentation comments to create the documentation. To enable this feature, open the file Areas/HelpPage/App_Start/HelpPageConfig.cs and uncomment the following line:
config.SetDocumentationProvider(new XmlDocumentationProvider(
HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));
Now enable XML documentation. In Solution Explorer, right-click the project and select Properties. Select the Build page.
Under Output, check XML documentation file. In the edit box, type “App_Data/XmlDocument.xml”.
Add some documentation comments to the controller methods. For example:
/// <summary>
/// Gets some very important data from the server.
/// </summary>
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
/// <summary>
/// Looks up some data by ID.
/// </summary>
/// <param name="id">The ID of the data.</param>
public string Get(int id)
{
return "value";
}