using API.DTO.Brand.Response; using FastEndpoints; using Microsoft.EntityFrameworkCore; namespace PyroFetes.Endpoints.Brand; public class GetAllBrandsEndpoint(PyroFetesDbContext pyrofetesdbcontext) : EndpointWithoutRequest> { public override void Configure() { Get("/api/brands"); AllowAnonymous(); } public override async Task HandleAsync(CancellationToken ct) { List responseDto = await pyrofetesdbcontext.Brands .Select(a => new GetBrandDto { Id = a.Id, Name = a.Name, } ).ToListAsync(ct); await Send.OkAsync(responseDto, ct); } }