我通過nuget將ASP.NET 4 Web API幫助頁面包安裝到了我的Web Api項目中。出於某種原因,它不顯示所有的API端點。我有文檔設置爲使用XML。不知道爲什麼會發生這種情況,任何幫助表示讚賞。ASP.NET Web API幫助頁面包無法獲取所有api端點
這裏有一個例子控制器
public class ProductController : BaseController
{
// GET api/Product/Get/5/43324
[AcceptVerbs("GET")]
public ApiProduct Get(int id, [FromUri]int productId)
{
//// logic
}
}
路線
config.Routes.MapHttpRoute(
name: "api-info",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional, action = RouteParameter.Optional }
);
感謝
你可以分享他們沒有出現的控制器嗎? –
更新了問題以顯示控制器,但並非顯示控制器的所有端點。 – tmjam
也可以分享路線? –