,但我是新来的属性的路由,而我不知道这是为什么不工作时一切不 所以我有这个属性路由返回404
[RoutePrefix("api/statistics")]
public class StatisticsController : ApiController
然后,我有
[HttpGet]
[Route("categoryTagsByTotalIssues/{categoryId:int}")]
public IHttpActionResult CategoryTagsByTotalIssues(int cateogryId)
从邮递员调用时 https://localhost:44363/api/statistics/categoryTagsByTotalIssues/3 返回404 但如果我不 https://localhost:44363/api/statistics/getTopFiveCategories 这是SOM这样的代码
[HttpGet]
[Route("getTopFiveCategories")]
public IHttpActionResult GetTopFiveCategories()
它的工作原理,我不知道为什么另一个人不能有人可以解释这个给我吗?
这看起来像是路由模板中的'categoryId'和动作参数中的'cateogryId'之间的拼写错误 – Nkosi