我使用属性路由来路由控制器中的动作,但是asp.net生成错误的帮助页面
[HttpGet]
[Route("getAll")]
[AllowAnonymous]
public IHttpActionResult GetCategories(){...}
答案 0 :(得分:0)
设置配置以使用属性路由。
public static class WebApiConfig
{
public static void Configure(HttpConfiguration configuration)
{
//the following config sets up your routing mechanism to use attributes
configuration.MapHttpAttributeRoutes();
}
}