Exemplo n.º 1
0
 /// <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();
 }
Exemplo n.º 2
0
 public static void ConfigureExceptionMiddleware(this IApplicationBuilder app, ExceptionMiddlewareOptions options)
 {
     app.UseMiddleware <ExceptionMiddleware>(options);
 }