WebApiThrottle
WebApiThrottle copied to clipboard
GlobalRates are not serialised due to the Rates property being interal
Hello Stefan,
Thanks for a great tool, and thanks for making it public.
I would like to have a default rate limit for clients with no pre-defined rules.
This is normally achievable by specifying the global rules in the constructor on ThrottlePolicy.
However, when I use an implementation of IPolicyRepositoryfor this, in which I serialise the object, these global settings (Stored in the internal property Rates) are not serialised, and are of course lost when the policy is re-loaded from the repository.
The immediate fix that springs to mind is to make the Rates property public, but I'm not sure what the intention was to make it internal.
Perhaps I am missing something - can anyone help?
Cheers, Matt