ASP.net web api 2 Route-Attribute not working

前端 未结 7 1886
野性不改
野性不改 2021-01-19 17:52

I\'ve the following problem, my route attribute is not working.

I have the following action:

[HttpGet]
[Route(\"~api/admin/template/{fileName}\")]
pu         


        
7条回答
  •  终归单人心
    2021-01-19 18:33

    With my Web API 2 project I had to add a [RoutePrefix("events")] to the controller for it to pickup the action route attribute.

提交回复
热议问题