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