namespace Brizco.Repository.Handlers.Routines; public class GetRoutineQueryHandler(IRepositoryWrapper repositoryWrapper) : IRequestHandler { public async Task Handle(GetRoutineQuery request, CancellationToken cancellationToken) { var shift = await repositoryWrapper.SetRepository() .TableNoTracking .Where(s => s.Id == request.Id) .Select(RoutineMapper.ProjectToSDto) .FirstOrDefaultAsync(cancellationToken); if (shift == null) throw new AppException("Shift not found", ApiResultStatusCode.NotFound); return shift; } }