我有一个MVC Web API项目,它运行良好,但出于某种原因,只有一个控制器的帮助文档中的条目没有出现。
直到最近,这一切都很好,不幸的是,虽然我不知道它在什么时候消失了,但它确实曾经存在过。
XML注释看起来都很好。 XmlDocument.xml文件看起来是正确的。
有没有办法在帮助文档中指定哪些控制器和方法功能? 如何确保此控制器的操作出现?
如果它有帮助,这是第一个动作的剪辑:
public class UserController : ApiController
{
/// <summary>
/// Get details of a user or all users, including accounts and group memberships
/// </summary>
/// <param name="username">The name of the user, if a single result is required</param>
/// <param name="account">The account id, if multiple results are required</param>
/// <param name="offset">The first row to return</param>
/// <param name="limit">The maximum number of rows to return</param>
/// <param name="sortby">The column to sort by, if required</param>
/// <param name="order">The sort order; asc[ending] (default) or desc[ending]</param>
/// <returns>Response structure including status and error message (if appropriate), as well as User structure including account and group details</returns>
[Route("user")]
[CombinedAuthentication(AuthLevel = "2")]
[HttpGet]
[AcceptVerbs("GET")]
public UserGetResponse Get(string username = "", int account = 0, int offset = 0, int limit = 0, string sortby = "", string order = "")
{
if (!string.IsNullOrEmpty(username))
{
return new UserGetResponse(username);
}
else
{
return new UserGetResponse(account, offset, limit, sortby, order);
}
}
}
答案 0 :(得分:0)
此位停止生成帮助文档条目:
[AcceptVerbs("GET")]
我删除了,一切都很好!