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