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