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的委托。