From 722b3d4fba5150b0b2a8612a5769097a201ab684 Mon Sep 17 00:00:00 2001 From: John Miller Date: Tue, 20 Aug 2024 11:18:26 +0100 Subject: [PATCH] Remove logger from endpoints --- Microservice.Customer.Api/Endpoints/Endpoints.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Microservice.Customer.Api/Endpoints/Endpoints.cs b/Microservice.Customer.Api/Endpoints/Endpoints.cs index 4ea5b9f..993a373 100644 --- a/Microservice.Customer.Api/Endpoints/Endpoints.cs +++ b/Microservice.Customer.Api/Endpoints/Endpoints.cs @@ -40,15 +40,10 @@ public static void ConfigureRoutes(this WebApplication app, ConfigurationManager }); customerGroup.MapPut("/update", [Authorize(AuthenticationSchemes = JwtBearerDefaults.AuthenticationScheme)] - async ([FromBody] UpdateCustomerRequest updateCustomerRequest, [FromServices] IMediator mediator, ICustomerHttpAccessor customerHttpAccessor, ILogger logger) => - { - logger.LogInformation("Start - Update customer: {0}", updateCustomerRequest.Id); - + async ([FromBody] UpdateCustomerRequest updateCustomerRequest, [FromServices] IMediator mediator, ICustomerHttpAccessor customerHttpAccessor) => + { updateCustomerRequest = updateCustomerRequest with { Id = customerHttpAccessor.CustomerId }; - var updateCustomerResponse = await mediator.Send(updateCustomerRequest); - - logger.LogInformation("End - Update customer: {0}", updateCustomerRequest.Id); - + var updateCustomerResponse = await mediator.Send(updateCustomerRequest); return Results.Ok(updateCustomerResponse); }) .Accepts("application/json")