我正在尝试通过以下方式实现请求限制:
我已将该代码提取到我的解决方案中,并使用以下属性修饰了API控制器端点:
[Route("api/dothis/{id}")]
[AcceptVerbs("POST")]
[Throttle(Name = "TestThrottle", Message = "You must wait {n} seconds before accessing this url again.", Seconds = 5)]
[Authorize]
public HttpResponseMessage DoThis(int id) {...}
Run Code Online (Sandbox Code Playgroud)
这会编译,但属性的代码不会被命中,并且限制不起作用.我没有收到任何错误.我错过了什么?