Share via


RateLimiterOptionsExtensions.AddFixedWindowLimiter Method

Definition

Registers a new FixedWindowRateLimiter with the given FixedWindowRateLimiterOptions to the application. The limiter can be added to an endpoint via RequireRateLimiting<TBuilder>(TBuilder, String), or via the EnableRateLimitingAttribute.

public static Microsoft.AspNetCore.RateLimiting.RateLimiterOptions AddFixedWindowLimiter (this Microsoft.AspNetCore.RateLimiting.RateLimiterOptions options, string policyName, Action<System.Threading.RateLimiting.FixedWindowRateLimiterOptions> configureOptions);
static member AddFixedWindowLimiter : Microsoft.AspNetCore.RateLimiting.RateLimiterOptions * string * Action<System.Threading.RateLimiting.FixedWindowRateLimiterOptions> -> Microsoft.AspNetCore.RateLimiting.RateLimiterOptions
<Extension()>
Public Function AddFixedWindowLimiter (options As RateLimiterOptions, policyName As String, configureOptions As Action(Of FixedWindowRateLimiterOptions)) As RateLimiterOptions

Parameters

options
RateLimiterOptions

The RateLimiterOptions to add a limiter to.

policyName
String

The name that will be associated with the limiter.

configureOptions
Action<FixedWindowRateLimiterOptions>

A callback to configure the FixedWindowRateLimiterOptions to be used for the limiter.

Returns

This RateLimiterOptions.

Remarks

Setting AutoReplenishment will have no effect here, as the PartitionedRateLimiter that this limiter is added to will control replenishing it.

Applies to