WebApi Help Page Description

后端 未结 3 1509
长发绾君心
长发绾君心 2020-12-04 17:36

What populates the Webapi method\'s description on the helper page and the introduction paragraph?

<script

3条回答
  •  爱一瞬间的悲伤
    2020-12-04 17:59

    To view the description you need to follow this :

    1. Every action in your Customer controller must have a XML documentation
    2. Open the properties of the project that contains your controllers and enable XML documenation like this : enter image description here
    3. In the Register method for HelpPageConfig class ( Areas/HelpPage/App_Start/HelpPageConfig.cs) uncomment the line 19 and don't forget to change the file path like this :

      config.SetDocumentationProvider(new XmlDocumentationProvider(
          HttpContext.Current.Server.MapPath("~/App_Data/MvcApplication4.XML"))
      );
      

    This all you must do. Last thing is to include the file created in App_Data in your project so the file will be deployed in production.

提交回复
热议问题