Class HttpContextExceptionHandlerExtensions
- Namespace
- MADE.Web.Extensions
- Assembly
- MADE.Web.dll
Defines a collection of extensions for IHttpContextExceptionHandler<TException> objects.
public static class HttpContextExceptionHandlerExtensions
- Inheritance
-
HttpContextExceptionHandlerExtensions
- Inherited Members
Methods
AddDefaultHttpContextExceptionHandler(IServiceCollection)
Adds the default Exception handlers to the service collection.
public static IServiceCollection AddDefaultHttpContextExceptionHandler(this IServiceCollection serviceCollection)
Parameters
serviceCollectionIServiceCollectionThe service collection.
Returns
- IServiceCollection
The configured service collection.
AddHttpContextExceptionHandler<TException, THandler>(IServiceCollection)
Adds a HttpContext exception handler to the service collection.
public static IServiceCollection AddHttpContextExceptionHandler<TException, THandler>(this IServiceCollection serviceCollection) where TException : Exception where THandler : class, IHttpContextExceptionHandler<TException>
Parameters
serviceCollectionIServiceCollectionThe service collection.
Returns
- IServiceCollection
The configured service collection.
Type Parameters
TExceptionThe type of exception handled.
THandlerThe type of exception handler.
UseHttpContextExceptionHandling(IApplicationBuilder)
Adds the IHttpContextExceptionHandler<TException> middleware to the application builder.
public static IApplicationBuilder UseHttpContextExceptionHandling(this IApplicationBuilder builder)
Parameters
builderIApplicationBuilderThe application builder.
Returns
- IApplicationBuilder
The configured application builder.