Skip to content

Commit eacb408

Browse files
committed
Use IMiddleware interface
1 parent 5546cbe commit eacb408

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

Source/Boxed.AspNetCore/Middleware/HttpExceptionMiddleware.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,13 @@ namespace Boxed.AspNetCore.Middleware
66
using Microsoft.Extensions.DependencyInjection;
77
using Microsoft.Extensions.Logging;
88

9-
internal class HttpExceptionMiddleware
9+
internal class HttpExceptionMiddleware : IMiddleware
1010
{
11-
private readonly RequestDelegate next;
12-
13-
public HttpExceptionMiddleware(RequestDelegate next) => this.next = next;
14-
15-
public async Task Invoke(HttpContext context)
11+
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
1612
{
1713
try
1814
{
19-
await this.next.Invoke(context).ConfigureAwait(false);
15+
await next.Invoke(context).ConfigureAwait(false);
2016
}
2117
catch (HttpException httpException)
2218
{

Source/Boxed.AspNetCore/Middleware/InternalServerErrorOnExceptionMiddleware.cs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,13 @@ namespace Boxed.AspNetCore.Middleware
55
using Microsoft.Extensions.DependencyInjection;
66
using Microsoft.Extensions.Logging;
77

8-
internal class InternalServerErrorOnExceptionMiddleware
8+
internal class InternalServerErrorOnExceptionMiddleware : IMiddleware
99
{
10-
private readonly RequestDelegate next;
11-
12-
public InternalServerErrorOnExceptionMiddleware(RequestDelegate next) => this.next = next;
13-
14-
public async Task Invoke(HttpContext context)
10+
public async Task InvokeAsync(HttpContext context, RequestDelegate next)
1511
{
1612
try
1713
{
18-
await this.next.Invoke(context).ConfigureAwait(false);
14+
await next.Invoke(context).ConfigureAwait(false);
1915
}
2016
catch
2117
{

0 commit comments

Comments
 (0)