WebApiThrottle icon indicating copy to clipboard operation
WebApiThrottle copied to clipboard

GlobalRates are not serialised due to the Rates property being interal

Open dendle opened this issue 8 years ago • 0 comments

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

dendle avatar Dec 02 '16 13:12 dendle