/// <summary> /// Initializes a new instance of the <see cref="ExceptionMiddleware"/> class. /// </summary> /// <param name="next"></param> /// <param name="options"><see cref="ExceptionMiddlewareOptions"/> to use to customize the current <see cref="ExceptionMiddleware"/> behavior.</param> public ExceptionMiddleware(RequestDelegate next, ExceptionMiddlewareOptions options) { _next = next ?? throw new ArgumentNullException(nameof(next)); _options = options ?? new ExceptionMiddlewareOptions(); }
public static void ConfigureExceptionMiddleware(this IApplicationBuilder app, ExceptionMiddlewareOptions options) { app.UseMiddleware <ExceptionMiddleware>(options); }