Skip to content

Commit 8764d42

Browse files
committed
Update ServiceExtensions.cs
Exception middelware added
1 parent 39d3ba0 commit 8764d42

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Supermarket/Extensions/ServiceExtensions.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
using Supermarket.Core.Models;
1414
using Supermarket.Core.Repositories;
1515
using Supermarket.Core.Repositories.Contracts;
16+
using Supermarket.Middleware;
1617
using Supermarket.Swagger;
1718
using Swashbuckle.AspNetCore.Swagger;
1819
using System;
@@ -157,5 +158,10 @@ public static void ConfigureVersionedApiExplorer(this IServiceCollection service
157158
options.SubstituteApiVersionInUrl = true;
158159
});
159160
}
161+
162+
public static void ConfigureCustomExceptionMiddleware(this IApplicationBuilder app)
163+
{
164+
app.UseMiddleware<ExceptionMiddleware>();
165+
}
160166
}
161167
}

0 commit comments

Comments
 (0)