using FastEndpoints; using Knots.DTO.Role; namespace Knots.Endpoints.Role; public class DeleteRoleEndpoint(KnotsDbContext db, AutoMapper.IMapper mapper) : Endpoint { public override void Configure() { Delete("/roles"); AllowAnonymous(); } public override async Task HandleAsync(DeleteRoleDto req, CancellationToken ct) { Models.Role? role = mapper.Map(req); db.Roles.Remove(role); await db.SaveChangesAsync(ct); await SendNoContentAsync(ct); } }