Open vickyRathee opened 5 years ago
I just hit this -- you have to use the new constructor as in that bit of the docs, with code like:
config.MessageHandlers.Add(new CustomThrottlingHandler(
policy: new ThrottlePolicy( /*perSecond: 10,...*/ )
{
IpThrottling = true,
// ...
},
repository: new CacheRepository(),
policyRepository: new PolicyCacheRepository(),
// ...
));
rather than
config.MessageHandlers.Add(new CustomThrottlingHandler()
{
Policy = ...,
Repository = ...
}
The
var policy = policyRepository.FirstOrDefault(ThrottleManager.GetPolicyKey());
is always nullHere is my code :
//Rate Limits
On the controller, I am simply checking if the Key is PAID customer update the rate limit to higher.