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

            configureOptions(options);

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