Class HttpContextDecoratorExtensions
- Namespace
- Cuemon.AspNetCore.Http
- Assembly
- Cuemon.AspNetCore.dll
Extension methods for the Microsoft.AspNetCore.Http.HttpContext class hidden behind the IDecorator<T> interface. This API supports the product infrastructure and is not intended to be used directly from your code.
public static class HttpContextDecoratorExtensions
- Inheritance
-
HttpContextDecoratorExtensions
Methods
InvokeApiKeySentinelAsync(IDecorator<HttpContext>, ApiKeySentinelOptions)
Common API key logic for ASP.NET Core and ASP.NET Core MVC. Not intended to be used directly from your code.
public static async Task InvokeApiKeySentinelAsync(this IDecorator<HttpContext> decorator, ApiKeySentinelOptions options)
Parameters
decorator
IDecorator<HttpContext>The IDecorator<T> to extend.
options
ApiKeySentinelOptionsThe configured options.
Returns
InvokeThrottlerSentinelAsync(IDecorator<HttpContext>, IThrottlingCache, ThrottlingSentinelOptions)
Common throttler operation logic for ASP.NET Core and ASP.NET Core MVC. Not intended to be used directly from your code.
public static async Task InvokeThrottlerSentinelAsync(this IDecorator<HttpContext> decorator, IThrottlingCache tc, ThrottlingSentinelOptions options)
Parameters
decorator
IDecorator<HttpContext>The IDecorator<T> to extend.
tc
IThrottlingCacheThe IThrottlingCache implementation.
options
ThrottlingSentinelOptionsThe configured options.
Returns
InvokeUserAgentSentinelAsync(IDecorator<HttpContext>, UserAgentSentinelOptions)
Common user agent logic for ASP.NET Core and ASP.NET Core MVC. Not intended to be used directly from your code.
public static async Task InvokeUserAgentSentinelAsync(this IDecorator<HttpContext> decorator, UserAgentSentinelOptions options)
Parameters
decorator
IDecorator<HttpContext>The IDecorator<T> to extend.
options
UserAgentSentinelOptionsThe configured options.
Returns
WriteExceptionDescriptorResponseAsync(IDecorator<HttpContext>, HttpExceptionDescriptorResponseHandler, HttpExceptionDescriptor, CancellationToken)
Invokes and write the result from the specified handler
to the response body. Not intended to be used directly from your code.
public static async Task WriteExceptionDescriptorResponseAsync(this IDecorator<HttpContext> decorator, HttpExceptionDescriptorResponseHandler handler, HttpExceptionDescriptor exceptionDescriptor, CancellationToken ct)
Parameters
decorator
IDecorator<HttpContext>The IDecorator<T> to extend.
handler
HttpExceptionDescriptorResponseHandlerThe HttpExceptionDescriptorResponseHandler that holds the content negotiation response.
exceptionDescriptor
HttpExceptionDescriptorThe HttpExceptionDescriptor that provides information about an Exception.
ct
CancellationTokenThe cancellation token that can be used by other objects or threads to receive notice of cancellation.
Returns
- Task
A Task representing the asynchronous operation.