using PyroFetes.DTO.Login.Response; using FastEndpoints; using Microsoft.EntityFrameworkCore; using PyroFetes; namespace PyroFetes.Endpoints.Login; public class GetAllLoginEndpoint(PyroFetesDbContext database) : EndpointWithoutRequest> { public override void Configure() { Get("/api/logins"); } public override async Task HandleAsync(CancellationToken ct) { var logins = await database.Logins .Select(login => new GetLoginDto() { Id = login.Id, Username = login.Username, FullName = login.FullName, Password = login.Password, Salt = login.Salt }) .ToListAsync(ct); await Send.OkAsync(logins, ct); } }