I'd like to set the rate to 2/min for function #1 and to 10/min for the 2nd function following the example as the code below. The code is running fine, but the throttling is not working at all. I can get an unlimited number of "value" and "value1 and value2". Do I also need to change settings in webApiConfig.cs? Please help.
using System.Web.Http;
using WebApiThrottle;
namespace wepApiThrottle.Controllers
{
[EnableThrottling(PerMinute = 2)]
public class ValuesController : ApiController
{
// GET api/values
[EnableThrottling(PerMinute = 2)]
public IEnumerable<string> Get()
{
return new string[] { "value1", "value2" };
}
// GET api/values/5
[EnableThrottling(PerMinute = 10)]
public string Get(int id)
{
return "value";
}
}
I'd like to set the rate to 2/min for function #1 and to 10/min for the 2nd function following the example as the code below. The code is running fine, but the throttling is not working at all. I can get an unlimited number of "value" and "value1 and value2". Do I also need to change settings in webApiConfig.cs? Please help.