diff --git a/Source/Boxed.AspNetCore/Middleware/HttpExceptionMiddleware.cs b/Source/Boxed.AspNetCore/Middleware/HttpExceptionMiddleware.cs index 57db73c5..e04bbe4a 100644 --- a/Source/Boxed.AspNetCore/Middleware/HttpExceptionMiddleware.cs +++ b/Source/Boxed.AspNetCore/Middleware/HttpExceptionMiddleware.cs @@ -6,17 +6,13 @@ namespace Boxed.AspNetCore.Middleware using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; - internal class HttpExceptionMiddleware + internal class HttpExceptionMiddleware : IMiddleware { - private readonly RequestDelegate next; - - public HttpExceptionMiddleware(RequestDelegate next) => this.next = next; - - public async Task Invoke(HttpContext context) + public async Task InvokeAsync(HttpContext context, RequestDelegate next) { try { - await this.next.Invoke(context).ConfigureAwait(false); + await next.Invoke(context).ConfigureAwait(false); } catch (HttpException httpException) { diff --git a/Source/Boxed.AspNetCore/Middleware/InternalServerErrorOnExceptionMiddleware.cs b/Source/Boxed.AspNetCore/Middleware/InternalServerErrorOnExceptionMiddleware.cs index 71ef25a8..b2952305 100644 --- a/Source/Boxed.AspNetCore/Middleware/InternalServerErrorOnExceptionMiddleware.cs +++ b/Source/Boxed.AspNetCore/Middleware/InternalServerErrorOnExceptionMiddleware.cs @@ -5,17 +5,13 @@ namespace Boxed.AspNetCore.Middleware using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; - internal class InternalServerErrorOnExceptionMiddleware + internal class InternalServerErrorOnExceptionMiddleware : IMiddleware { - private readonly RequestDelegate next; - - public InternalServerErrorOnExceptionMiddleware(RequestDelegate next) => this.next = next; - - public async Task Invoke(HttpContext context) + public async Task InvokeAsync(HttpContext context, RequestDelegate next) { try { - await this.next.Invoke(context).ConfigureAwait(false); + await next.Invoke(context).ConfigureAwait(false); } catch {