Attributes confusion
hey! I'm having trouble choosing an approach when using attributes.
I'm building a wrapper around
here’s the problem: I want to be able to create custom ignore policies (to have no limit in custom conditions) and pass them directly to the
initially I wanted to make a base class
but the policies here can exist without the main
also, I thought about passing the policies directly to the main attribute, but this approach is not possible because the values in attribute parameters must be constant, so I can't just pass a list of policies. additionally, it'll be a very long line in length if I have many policies
how can I implement this most conveniently?
I'm building a wrapper around
System.Threading.RateLimiting. I have an attribute RateLimitAttribute which is responsible for the basic logic and creation of PartitionedRateLimiter. here’s the problem: I want to be able to create custom ignore policies (to have no limit in custom conditions) and pass them directly to the
RateLimitAttribute, but I don’t know how to do this correctly and what approach to choose.initially I wanted to make a base class
RateLimitPolicyAttribute for all policies and later use it like this:but the policies here can exist without the main
RateLimitAttributealso, I thought about passing the policies directly to the main attribute, but this approach is not possible because the values in attribute parameters must be constant, so I can't just pass a list of policies. additionally, it'll be a very long line in length if I have many policies
how can I implement this most conveniently?