From 8c86c6153347b8aafe7e3b44d5a9e7075585ecc6 Mon Sep 17 00:00:00 2001 From: Leshchev Artem Date: Mon, 8 Jul 2024 11:25:03 +0200 Subject: [PATCH] fix error with unable to resolve service (#19) Co-authored-by: Artem Leshchev --- src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs | 5 +++-- src/__SolutionItems/CommonAssemblyInfo.cs | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs b/src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs index 3c489d0..a9774fd 100644 --- a/src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs +++ b/src/Bss.Platform.Api.Middlewares/ErrorsMiddleware.cs @@ -4,13 +4,14 @@ using Bss.Platform.Api.Middlewares.Interfaces; using Microsoft.AspNetCore.Http; +using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Logging; namespace Bss.Platform.Api.Middlewares; public class ErrorsMiddleware(RequestDelegate next) { - public async Task InvokeAsync(HttpContext context, ILogger logger, IStatusCodeResolver? statusCodeResolver) + public async Task InvokeAsync(HttpContext context, ILogger logger, IServiceProvider serviceProvider) { try { @@ -20,7 +21,7 @@ public async Task InvokeAsync(HttpContext context, ILogger log { logger.LogError(e, "Request failed"); - await HandleExceptionAsync(context, e, statusCodeResolver); + await HandleExceptionAsync(context, e, serviceProvider.GetService()); } } diff --git a/src/__SolutionItems/CommonAssemblyInfo.cs b/src/__SolutionItems/CommonAssemblyInfo.cs index ff43995..b3992b9 100644 --- a/src/__SolutionItems/CommonAssemblyInfo.cs +++ b/src/__SolutionItems/CommonAssemblyInfo.cs @@ -4,9 +4,9 @@ [assembly: AssemblyCompany("Luxoft")] [assembly: AssemblyCopyright("Copyright © Luxoft 2024")] -[assembly: AssemblyVersion("1.5.4.0")] -[assembly: AssemblyFileVersion("1.5.4.0")] -[assembly: AssemblyInformationalVersion("1.5.4.0")] +[assembly: AssemblyVersion("1.5.5.0")] +[assembly: AssemblyFileVersion("1.5.5.0")] +[assembly: AssemblyInformationalVersion("1.5.5.0")] #if DEBUG [assembly: AssemblyConfiguration("Debug")]