1. Install the Microsoft.AspNet.WebApi.HelpPage package
Install-Package Microsoft.AspNet.WebApi.HelpPage
2. Register Area
protected void Application_Start(){ AreaRegistration.RegisterAllAreas();}
3. Helppageconfig Enable Setdocumentationprovider
Webapplication/areas/helppage/app_start/helppageconfig.cs directory, locate the following code and uncomment it (App_Data to Bin):
public static void Register(HttpConfiguration config){ //// Uncomment the following to use the documentation from XML documentation file. config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/bin/XmlDocument.xml")));}
4. WebApplication Build configuration XmlDocument Output path
5. Valuescontroller Code
///<summary>Values Controller///</summary> public class Valuescontroller: apicontroller{..... //<summary>///POST operation/// </summary>/ <param name= "value" > Value </param> public void Post ([frombody]string value) {}}
6. Effects
Help Page
Help/api/post-api-values
ASP. NET Web API creation help page