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

            configureOptions(options);

            return(builder.UseMiddleware <ApiExceptionMiddleware>(options));
        }
Beispiel #3
0
        public static IApplicationBuilder UseApiExceptionHandler(this IApplicationBuilder builder)
        {
            var options = new ApiExceptionOptions();

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