RateLimiterServiceCollectionExtensions.AddRateLimiter 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
AddRateLimiter(IServiceCollection) |
新增速率限制服務並設定相關選項。 |
AddRateLimiter(IServiceCollection, Action<RateLimiterOptions>) |
新增速率限制服務並設定相關選項。 |
AddRateLimiter(IServiceCollection)
新增速率限制服務並設定相關選項。
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddRateLimiter (this Microsoft.Extensions.DependencyInjection.IServiceCollection services);
static member AddRateLimiter : Microsoft.Extensions.DependencyInjection.IServiceCollection -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddRateLimiter (services As IServiceCollection) As IServiceCollection
參數
- services
- IServiceCollection
用於新增服務的 IServiceCollection。
傳回
適用於
AddRateLimiter(IServiceCollection, Action<RateLimiterOptions>)
新增速率限制服務並設定相關選項。
public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddRateLimiter (this Microsoft.Extensions.DependencyInjection.IServiceCollection services, Action<Microsoft.AspNetCore.RateLimiting.RateLimiterOptions> configureOptions);
static member AddRateLimiter : Microsoft.Extensions.DependencyInjection.IServiceCollection * Action<Microsoft.AspNetCore.RateLimiting.RateLimiterOptions> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddRateLimiter (services As IServiceCollection, configureOptions As Action(Of RateLimiterOptions)) As IServiceCollection
參數
- services
- IServiceCollection
用於新增服務的 IServiceCollection。
- configureOptions
- Action<RateLimiterOptions>
要設定 RateLimiterOptions的委派。