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);