Note
Access to this page requires authorization. You can try signing in or .
Access to this page requires authorization. You can try .
RateLimiterOptionsExtensions.AddFixedWindowLimiter Method
Definition
- Namespace:
- Microsoft.AspNetCore.RateLimiting
- Assembly:
- Microsoft.AspNetCore.RateLimiting.dll
- Package:
- Microsoft.AspNetCore.App.Ref v10.0.0
- Package:
- Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
- Package:
- Microsoft.AspNetCore.RateLimiting v7.0.0-rc.2.22476.2
- Package:
- Microsoft.AspNetCore.App.Ref v8.0.19
- Package:
- Microsoft.AspNetCore.App.Ref v9.0.8
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.
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
Feedback
Was this page helpful?
