我无法弄清楚如何在我的Web Api中获取帮助页面以显示除None之外的资源描述.它链接了IHttpActionResult,然后是"无".之后.我通过添加config.SetActualResponseType(typeof(ComplexType), "Controller", "Action");
到HelpPageConfig.cs使我的示例工作.我的控制器看起来像这样:
/// <summary>
/// My description
/// </summary>
[Route("MyRoute")]
public IHttpActionResult Get()
{
try
{
//throw new Exception("TEST");
return Ok(returnValue);
}
catch (Exception ex)
{
*Company Log Method*
return NotFound();
}
}
Run Code Online (Sandbox Code Playgroud)
我不知道HelpPageConfig.cs或其他任何地方我缺少什么.也许一双新鲜的眼睛可以抓住一些东西.在此先感谢您的帮助!