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

            configureOptions(options);

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