using FastEndpoints; using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Customer.Response; namespace PyroFetes.Endpoints.Customer; public class GetAllCustomerEndpoint(PyroFetesDbContext pyroFetesDbContext) : EndpointWithoutRequest> { public override void Configure() { Get ("/customers"); AllowAnonymous(); } public override async Task HandleAsync(CancellationToken ct) { List customer= await pyroFetesDbContext.Customers.Select(x => new GetCustomerDto() { Id = x.Id, Note = x.Note, }).ToListAsync(ct); await Send.OkAsync(customer, ct); } }