First Commit 09/10

# Conflicts:
#	PyroFetes/PyroFetes.csproj
This commit is contained in:
2025-10-09 17:12:17 +02:00
parent 0e19ef1ab7
commit 4e64112a31
49 changed files with 908 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
using Microsoft.EntityFrameworkCore;
using PyroFetes.DTO.ExperienceLevel.Response;
namespace PyroFetes.Endpoints.ExperienceLevel;
using FastEndpoints;
public class GetAllExperienceLevelsEndpoint(PyroFetesDbContext pyroFetesDbContext) : EndpointWithoutRequest<List<GetExperienceLevelDto>>
{
public override void Configure()
{
Get ("/api/experienceLevels");
AllowAnonymous();
}
public override async Task HandleAsync(CancellationToken ct)
{
List<GetExperienceLevelDto> experienceLevels= await pyroFetesDbContext.ExperienceLevels.Select(x => new GetExperienceLevelDto()
{
Id = x.Id,
}).ToListAsync(ct);
await Send.OkAsync(experienceLevels, ct);
}
}