public ApiErrorHandlerMiddleware( RequestDelegate next, ILoggerFactory loggerFactory, ObjectResultExecutor objectResultExecutor) { _next = next; _logger = loggerFactory.CreateLogger<ApiErrorHandlerMiddleware>(); _objectResultExecutor = objectResultExecutor; var defaultProblemDetectionHandler = new DefaultProblemDetectionHandler(loggerFactory.CreateLogger<DefaultProblemDetectionHandler>()); _contextProblemDetectionHandler = defaultProblemDetectionHandler; _exceptionProblemDetectionHandler = defaultProblemDetectionHandler; }
public ApiErrorHandlerMiddleware( RequestDelegate next, ILogger<ApiErrorHandlerMiddleware> logger, ObjectResultExecutor objectResultExecutor, IContextProblemDetectionHandler contextProblemDetectionHandler, IExceptionProblemDetectionHandler exceptionProblemDetectionHandler) { _next = next; _logger = logger; _objectResultExecutor = objectResultExecutor; _contextProblemDetectionHandler = contextProblemDetectionHandler; _exceptionProblemDetectionHandler = exceptionProblemDetectionHandler; }
public async Task ExecuteResultAsync(ObjectResultExecutor executor, ActionContext context) { ObjectResult objectResult = ExecuteFirstStep(context); await executor.ExecuteAsync(context, objectResult); }