一、添加包Microsoft.AspNet.WebApi.HelpPage可以自动给api生成帮助页面,url:/help

二、help加注释:

1.Mvc api HelpPage 与注释

2.

public static class HelpPageConfig
{
[SuppressMessage("Microsoft.Globalization", "CA1303:Do not pass literals as localized parameters",
MessageId = "WebApplication2.Areas.HelpPage.TextSample.#ctor(System.String)",
Justification = "End users may choose to merge this string with existing localized resources.")]
[SuppressMessage("Microsoft.Naming", "CA2204:Literals should be spelled correctly",
MessageId = "bsonspec",
Justification = "Part of a URI.")]
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/WebApplication2.XML")));

 

相关文章:

  • 2021-12-25
  • 2022-02-27
  • 2022-12-23
  • 2021-04-01
  • 2021-11-13
  • 2022-12-23
  • 2021-12-05
  • 2022-01-22
猜你喜欢
  • 2021-09-27
  • 2022-12-23
  • 2021-12-06
  • 2022-02-02
  • 2022-12-23
  • 2021-11-06
  • 2021-11-26
相关资源
相似解决方案