共用方式為


RateLimiterOptions.AddPolicy 方法

定義

多載

AddPolicy<TPartitionKey,TPolicy>(String)

使用指定的 policyName 新增速率限制原則。

AddPolicy<TPartitionKey>(String, IRateLimiterPolicy<TPartitionKey>)

使用指定的 policyName 新增速率限制原則。

AddPolicy<TPartitionKey>(String, Func<HttpContext,RateLimitPartition<TPartitionKey>>)

使用指定的 新增速率限制原則 policyName

AddPolicy<TPartitionKey,TPolicy>(String)

來源:
RateLimiterOptions.cs

使用指定的 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

類型參數

TPartitionKey
TPolicy

參數

policyName
String

要與指定 TPolicy 相關聯的名稱。

傳回

適用於

AddPolicy<TPartitionKey>(String, IRateLimiterPolicy<TPartitionKey>)

來源:
RateLimiterOptions.cs

使用指定的 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

類型參數

TPartitionKey

參數

policyName
String

要與指定 IRateLimiterPolicy<TPartitionKey> 相關聯的名稱。

傳回

適用於

AddPolicy<TPartitionKey>(String, Func<HttpContext,RateLimitPartition<TPartitionKey>>)

來源:
RateLimiterOptions.cs

使用指定的 新增速率限制原則 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

類型參數

TPartitionKey

參數

policyName
String

要與指定 RateLimiter 相關聯的名稱。

partitioner
Func<HttpContext,RateLimitPartition<TPartitionKey>>

每次進行 Acquire 或 WaitAsync 呼叫時呼叫的方法,以判斷要套用至要求的速率限制器。

傳回

適用於