customer type affiché
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user