RateLimiterOptions.AddPolicy Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddPolicy<TPartitionKey,TPolicy>(String) |
Adds a new rate limiting policy with the given policyName. |
AddPolicy<TPartitionKey>(String, IRateLimiterPolicy<TPartitionKey>) |
Adds a new rate limiting policy with the given policyName. |
AddPolicy<TPartitionKey>(String, Func<HttpContext,RateLimitPartition<TPartitionKey>>) |
Adds a new rate limiting policy with the given |
AddPolicy<TPartitionKey,TPolicy>(String)
- Source:
- RateLimiterOptions.cs
Adds a new rate limiting policy with the given policyName.
public Microsoft.AspNetCore.RateLimiting.RateLimiterOptions AddPolicy<TPartitionKey,TPolicy> (string policyName) where TPolicy : Microsoft.AspNetCore.RateLimiting.IRateLimiterPolicy<TPartitionKey>;
member this.AddPolicy : string -> Microsoft.AspNetCore.RateLimiting.RateLimiterOptions (requires 'Policy :> Microsoft.AspNetCore.RateLimiting.IRateLimiterPolicy<'PartitionKey>)
Public Function AddPolicy(Of TPartitionKey, TPolicy) (policyName As String) As RateLimiterOptions
Type Parameters
- TPartitionKey
- TPolicy
Parameters
- policyName
- String
The name to be associated with the given TPolicy.
Returns
Applies to
AddPolicy<TPartitionKey>(String, IRateLimiterPolicy<TPartitionKey>)
- Source:
- RateLimiterOptions.cs
Adds a new rate limiting policy with the given policyName.
public Microsoft.AspNetCore.RateLimiting.RateLimiterOptions AddPolicy<TPartitionKey> (string policyName, Microsoft.AspNetCore.RateLimiting.IRateLimiterPolicy<TPartitionKey> policy);
member this.AddPolicy : string * Microsoft.AspNetCore.RateLimiting.IRateLimiterPolicy<'PartitionKey> -> Microsoft.AspNetCore.RateLimiting.RateLimiterOptions
Public Function AddPolicy(Of TPartitionKey) (policyName As String, policy As IRateLimiterPolicy(Of TPartitionKey)) As RateLimiterOptions
Type Parameters
- TPartitionKey
Parameters
- policyName
- String
The name to be associated with the given IRateLimiterPolicy<TPartitionKey>.
The IRateLimiterPolicy<TPartitionKey> to be applied.
Returns
Applies to
AddPolicy<TPartitionKey>(String, Func<HttpContext,RateLimitPartition<TPartitionKey>>)
- Source:
- RateLimiterOptions.cs
Adds a new rate limiting policy with the given policyName
public Microsoft.AspNetCore.RateLimiting.RateLimiterOptions AddPolicy<TPartitionKey> (string policyName, Func<Microsoft.AspNetCore.Http.HttpContext,System.Threading.RateLimiting.RateLimitPartition<TPartitionKey>> partitioner);
member this.AddPolicy : string * Func<Microsoft.AspNetCore.Http.HttpContext, System.Threading.RateLimiting.RateLimitPartition<'PartitionKey>> -> Microsoft.AspNetCore.RateLimiting.RateLimiterOptions
Public Function AddPolicy(Of TPartitionKey) (policyName As String, partitioner As Func(Of HttpContext, RateLimitPartition(Of TPartitionKey))) As RateLimiterOptions
Type Parameters
- TPartitionKey
Parameters
- policyName
- String
The name to be associated with the given RateLimiter.
- partitioner
- Func<HttpContext,RateLimitPartition<TPartitionKey>>
Method called every time an Acquire or WaitAsync call is made to determine what rate limiter to apply to the request.