12 references to AddPolicy
Microsoft.AspNetCore.RateLimiting (4)
RateLimiterOptionsExtensions.cs (4)
36return options.AddPolicy(policyName, context => 65return options.AddPolicy(policyName, context => 94return options.AddPolicy(policyName, context => 117return options.AddPolicy(policyName, context =>
Microsoft.AspNetCore.RateLimiting.Tests (8)
RateLimitingMiddlewareTests.cs (3)
188options.Value.AddPolicy<string>(name, (context => 473options.Value.AddPolicy<string>(endpointName1, key => 480options.Value.AddPolicy<string>(endpointName2, key =>
RateLimitingOptionsTests.cs (5)
16Assert.Throws<ArgumentNullException>(() => options.AddPolicy<string>(null, context => RateLimitPartition.GetNoLimiter<string>("myKey"))); 23Assert.Throws<ArgumentNullException>(() => options.AddPolicy<string>("myKey", partitioner: null)); 37options.AddPolicy<string>("myKey", context => RateLimitPartition.GetNoLimiter<string>("myKey")); 38Assert.Throws<ArgumentException>(() => options.AddPolicy<string>("myKey", context => RateLimitPartition.GetNoLimiter<string>("yourKey"))); 45options.AddPolicy<string>("myKey", context => RateLimitPartition.GetNoLimiter<string>("myKey"));