From 35c99928ad17bbbbf77f4c4c6047c4f7f5354cb9 Mon Sep 17 00:00:00 2001 From: MathieuCarteron Date: Wed, 10 Jun 2026 21:43:38 +0200 Subject: [PATCH] =?UTF-8?q?customer=20type=20affich=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PyroFetes/DTO/Customer/Response/GetCustomerDto.cs | 2 ++ PyroFetes/Endpoints/Customer/GetAllCustomerEndpoint.cs | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/PyroFetes/DTO/Customer/Response/GetCustomerDto.cs b/PyroFetes/DTO/Customer/Response/GetCustomerDto.cs index 54fb346..91021b4 100644 --- a/PyroFetes/DTO/Customer/Response/GetCustomerDto.cs +++ b/PyroFetes/DTO/Customer/Response/GetCustomerDto.cs @@ -6,4 +6,6 @@ public class GetCustomerDto public string? Note { get; set; } public int CustomerTypeId { get; set; } + + public string? CustomerType { get; set; } } \ No newline at end of file diff --git a/PyroFetes/Endpoints/Customer/GetAllCustomerEndpoint.cs b/PyroFetes/Endpoints/Customer/GetAllCustomerEndpoint.cs index 0d79b76..d3337ed 100644 --- a/PyroFetes/Endpoints/Customer/GetAllCustomerEndpoint.cs +++ b/PyroFetes/Endpoints/Customer/GetAllCustomerEndpoint.cs @@ -14,10 +14,11 @@ public class GetAllCustomerEndpoint(PyroFetesDbContext pyroFetesDbContext) : End public override async Task HandleAsync(CancellationToken ct) { - List customer= await pyroFetesDbContext.Customers.Select(x => new GetCustomerDto() + List customer= await pyroFetesDbContext.Customers.Include(x => x.CustomerType).Select(x => new GetCustomerDto() { Id = x.Id, Note = x.Note, + CustomerType = x.CustomerType.Label, }).ToListAsync(ct); await Send.OkAsync(customer, ct);