using Brizco.Domain.Dtos.LargeDtos; namespace Brizco.Repository.Handlers.Section; public class GetSectionQueryHandler : IRequestHandler { private readonly IRepositoryWrapper _repositoryWrapper; public GetSectionQueryHandler(IRepositoryWrapper repositoryWrapper) { _repositoryWrapper = repositoryWrapper; } public async Task Handle(GetSectionQuery request, CancellationToken cancellationToken) { var shift = await _repositoryWrapper.SetRepository() .TableNoTracking .Where(s => s.Id == request.Id) .Select(SectionMapper.ProjectToLDto) .FirstOrDefaultAsync(cancellationToken); if (shift == null) throw new AppException("Section not found", ApiResultStatusCode.NotFound); return shift; } }