2 instantiations of DefaultKeyType
Microsoft.AspNetCore.RateLimiting (2)
RateLimiterOptions.cs (1)
114
var partitionKey = new
DefaultKeyType
(policyName, partition.PartitionKey, partition.Factory);
RateLimitingMiddleware.cs (1)
25
private readonly DefaultKeyType _defaultPolicyKey = new
DefaultKeyType
("__defaultPolicy", new PolicyNameKey { PolicyName = "__defaultPolicyKey" });
14 references to DefaultKeyType
Microsoft.AspNetCore.RateLimiting (14)
DefaultKeyTypeEqualityComparer.cs (4)
8
internal sealed class DefaultKeyTypeEqualityComparer : IEqualityComparer<
DefaultKeyType
>
10
public bool Equals(
DefaultKeyType
x,
DefaultKeyType
y)
26
public int GetHashCode([DisallowNull]
DefaultKeyType
obj)
DefaultRateLimiterPolicy.cs (4)
9
internal sealed class DefaultRateLimiterPolicy : IRateLimiterPolicy<
DefaultKeyType
>
11
private readonly Func<HttpContext, RateLimitPartition<
DefaultKeyType
>> _partitioner;
14
public DefaultRateLimiterPolicy(Func<HttpContext, RateLimitPartition<
DefaultKeyType
>> partitioner, Func<OnRejectedContext, CancellationToken, ValueTask>? onRejected)
22
public RateLimitPartition<
DefaultKeyType
> GetPartition(HttpContext httpContext)
RateLimiterOptions.cs (3)
109
internal static Func<HttpContext, RateLimitPartition<
DefaultKeyType
>> ConvertPartitioner<TPartitionKey>(string? policyName, Func<HttpContext, RateLimitPartition<TPartitionKey>> partitioner)
114
var
partitionKey = new DefaultKeyType(policyName, partition.PartitionKey, partition.Factory);
115
return new RateLimitPartition<
DefaultKeyType
>(partitionKey, static key => ((Func<TPartitionKey, RateLimiter>)key.Factory!)((TPartitionKey)key.Key!));
RateLimitingMiddleware.cs (3)
25
private readonly
DefaultKeyType
_defaultPolicyKey = new DefaultKeyType("__defaultPolicy", new PolicyNameKey { PolicyName = "__defaultPolicyKey" });
255
return PartitionedRateLimiter.Create<HttpContext,
DefaultKeyType
>(context =>
261
return RateLimitPartition.GetNoLimiter<
DefaultKeyType
>(_defaultPolicyKey);