public async Task <List <PriorityListVm> > Handle( GetPriorityListQuery request, CancellationToken cancellationToken) { var allPriorities = (await _priorityRepository.ListAllAsync()); return(_mapper.Map <List <PriorityListVm> >(allPriorities)); }
public async Task <List <GetPriorityListDTO> > Handle(GetPriorityListQuery request, CancellationToken cancellationToken) { var vm = new List <GetPriorityListDTO>(); vm = await _context.Priority .ProjectTo <GetPriorityListDTO>(_mapper.ConfigurationProvider) .OrderBy(t => t.Name) .ToListAsync(cancellationToken); return(vm); }