using FastEndpoints; using Microsoft.EntityFrameworkCore; using PyroFetes.DTO.Provider.Response; namespace PyroFetes.Endpoints.Provider; public class GetAllProvidersEndpoint(PyroFetesDbContext pyroFetesDbContext) : EndpointWithoutRequest> { public override void Configure() { Get ("/providers"); AllowAnonymous(); } public override async Task HandleAsync(CancellationToken ct) { List customer= await pyroFetesDbContext.Providers.Select(x => new GetProviderDto() { Id = x.Id, Price = x.Price, }).ToListAsync(ct); await Send.OkAsync(customer, ct); } }