Web API Routing - api/{controller}/{action}/{id} “dysfunctions” api/{controller}/{id}

前端 未结 5 770
一向
一向 2020-12-02 06:16

I have the default Route in Global.asax:

 RouteTable.Routes.MapHttpRoute(
         name: \"DefaultApi\",
         routeTemplate: \"api/{controller}/{id}\",
          


        
5条回答
  •  清歌不尽
    2020-12-02 07:04

    The possible reason can also be that you have not inherited Controller from ApiController. Happened with me took a while to understand the same.

提交回复
热议问题