public ApiExceptionMiddleware(ApiExceptionOptions options, RequestDelegate next,
                               ILogger <ApiExceptionMiddleware> logger)
 {
     _next    = next;
     _logger  = logger;
     _options = options;
 }
Exemple #2
0
        public static IApplicationBuilder UseApiExceptionHandler(this IApplicationBuilder builder,
                                                                 Action <ApiExceptionOptions> configureOptions)
        {
            var options = new ApiExceptionOptions();

            configureOptions(options);

            return(builder.UseMiddleware <ApiExceptionMiddleware>(options));
        }