Class ThrottlingSentinelMiddleware
Provides an API throttling middleware implementation for ASP.NET Core.
Inheritance
System.Object
ThrottlingSentinelMiddleware
Implements
Inherited Members
Namespace: Cuemon.AspNetCore.Http.Throttling
Assembly: Cuemon.AspNetCore.dll
Syntax
public class ThrottlingSentinelMiddleware : ConfigurableMiddleware<IThrottlingCache, ThrottlingSentinelOptions>, IConfigurable<ThrottlingSentinelOptions>
Constructors
| Improve this DocThrottlingSentinelMiddleware(RequestDelegate, IOptions<ThrottlingSentinelOptions>)
Initializes a new instance of the ThrottlingSentinelMiddleware class.
Declaration
public ThrottlingSentinelMiddleware(RequestDelegate next, IOptions<ThrottlingSentinelOptions> setup)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.RequestDelegate | next | The delegate of the request pipeline to invoke. |
Microsoft.Extensions.Options.IOptions<ThrottlingSentinelOptions> | setup | The ThrottlingSentinelOptions which need to be configured. |
ThrottlingSentinelMiddleware(RequestDelegate, Action<ThrottlingSentinelOptions>)
Initializes a new instance of the ThrottlingSentinelMiddleware class.
Declaration
public ThrottlingSentinelMiddleware(RequestDelegate next, Action<ThrottlingSentinelOptions> setup)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.RequestDelegate | next | The delegate of the request pipeline to invoke. |
System.Action<ThrottlingSentinelOptions> | setup | The ThrottlingSentinelOptions which need to be configured. |
Methods
| Improve this DocInvokeAsync(HttpContext, IThrottlingCache)
Executes the ThrottlingSentinelMiddleware.
Declaration
public override Task InvokeAsync(HttpContext context, IThrottlingCache tc)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.HttpContext | context | The context of the current request. |
IThrottlingCache | tc | The dependency injected IThrottlingCache of InvokeAsync(HttpContext, IThrottlingCache). |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task | A task that represents the execution of this middleware. |
Overrides
Cuemon.AspNetCore.ConfigurableMiddleware<Cuemon.AspNetCore.Http.Throttling.IThrottlingCache, Cuemon.AspNetCore.Http.Throttling.ThrottlingSentinelOptions>.InvokeAsync(Microsoft.AspNetCore.Http.HttpContext, Cuemon.AspNetCore.Http.Throttling.IThrottlingCache)