namespace Brizco.Repository.Handlers.Shifts; public class DeletePositionCommandHandler(IRepositoryWrapper repositoryWrapper) : IRequestHandler { public async Task Handle(DeleteShiftCommand request, CancellationToken cancellationToken) { var shift = await repositoryWrapper.SetRepository() .TableNoTracking .FirstOrDefaultAsync(s => s.Id == request.Id, cancellationToken); if (shift == null) throw new AppException("Routine not found", ApiResultStatusCode.NotFound); repositoryWrapper.SetRepository() .Delete(shift); await repositoryWrapper.SaveChangesAsync(cancellationToken); return true; } }