finalisation des endpoints

This commit is contained in:
2025-11-13 15:11:12 +01:00
parent 55f92ad761
commit 5c12a45ae6
41 changed files with 79 additions and 258 deletions

View File

@@ -1,11 +1,10 @@
using FastEndpoints;
using PF3.DTO.SoundCategory.Request;
using PF3.DTO.SoundCategory.Response;
using PF3.Models;
using PyroFetes.DTO.SoundCategory.Request;
using PyroFetes.DTO.SoundCategory.Response;
namespace PF3.Endpoints.SoundCategory;
namespace PyroFetes.Endpoints.SoundCategory;
public class CreateSoundCategoryEndpoint(PF3DbContext pf3DbContext) : Endpoint<CreateSoundCategoryDto, ReadSoundCategoryDto>
public class CreateSoundCategoryEndpoint(PyroFetesDbContext pyroFetesDbContext) : Endpoint<CreateSoundCategoryDto, ReadSoundCategoryDto>
{
public override void Configure()
{
@@ -15,13 +14,13 @@ public class CreateSoundCategoryEndpoint(PF3DbContext pf3DbContext) : Endpoint<C
public override async Task HandleAsync(CreateSoundCategoryDto req, CancellationToken ct)
{
var soundCategory = new Models.SoundCategory
var soundCategory = new PyroFetes.Models.SoundCategory
{
Name = req.Name,
};
pf3DbContext.SoundsCategorys.Add(soundCategory);
await pf3DbContext.SaveChangesAsync(ct);
pyroFetesDbContext.SoundCategories.Add(soundCategory);
await pyroFetesDbContext.SaveChangesAsync(ct);
var result = new ReadSoundCategoryDto
{