customer type affiché

This commit is contained in:
2026-06-10 21:43:38 +02:00
parent a88ce4cc7e
commit 35c99928ad
2 changed files with 4 additions and 1 deletions
@@ -6,4 +6,6 @@ public class GetCustomerDto
public string? Note { get; set; }
public int CustomerTypeId { get; set; }
public string? CustomerType { get; set; }
}
@@ -14,10 +14,11 @@ public class GetAllCustomerEndpoint(PyroFetesDbContext pyroFetesDbContext) : End
public override async Task HandleAsync(CancellationToken ct)
{
List<GetCustomerDto> customer= await pyroFetesDbContext.Customers.Select(x => new GetCustomerDto()
List<GetCustomerDto> 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);