我正在尝试通过以下方式实现请求限制:
我已将该代码导入我的解决方案,并使用属性修饰了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) {...}
这段代码可以编译通过,但属性的代码没有被执行,并且限流也没有生效。虽然我没有收到任何错误提示,但是我错过了什么吗?