public ProblemDetailsErrorResponseHandlerMiddleware(RequestDelegate next, ILogger <ProblemDetailsErrorResponseHandlerMiddleware> logger, IServiceProvider serviceProvider, ProblemDetailsErrorResponseHandlerOptions errorResponseoptions)
 {
     _next   = next;
     _logger = logger;
     _errorResponseoptions          = errorResponseoptions;
     _recyclableMemoryStreamManager = new RecyclableMemoryStreamManager();
     _clearCacheHeadersDelegate     = OnResponseStarting;
 }
 public ProblemDetailsErrorResponseHandlerMiddleware(RequestDelegate next, ILogger <ProblemDetailsErrorResponseHandlerMiddleware> logger, IOptions <ProblemDetailsErrorResponseHandlerOptions> options)
 {
     _next    = next;
     _logger  = logger;
     _options = options.Value;
     _recyclableMemoryStreamManager = new RecyclableMemoryStreamManager();
     _clearCacheHeadersDelegate     = OnResponseStarting;
 }
Ejemplo n.º 3
0
        public static IApplicationBuilder UseProblemDetailsErrorResponseHandler(this IApplicationBuilder app, Action <ProblemDetailsErrorResponseHandlerOptions> configureOptions = null)
        {
            var options = new ProblemDetailsErrorResponseHandlerOptions();

            if (configureOptions != null)
            {
                configureOptions(options);
            }

            return(app.UseMiddleware <ProblemDetailsErrorResponseHandlerMiddleware>(Options.Create(options)));
        }