예제 #1
0
        public async Task <List <PriorityListVm> > Handle(
            GetPriorityListQuery request,
            CancellationToken cancellationToken)
        {
            var allPriorities = (await _priorityRepository.ListAllAsync());

            return(_mapper.Map <List <PriorityListVm> >(allPriorities));
        }
예제 #2
0
            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);
            }