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