Пример #1
0
        public async Task <IEnumerable <CardViewModel> > Handle(GetAllCardsQuery request, CancellationToken cancellationToken)
        {
            var cardsList = await _genericRepository.GetAllAsync();

            var cardsListVm = _mapper.Map <IEnumerable <CardViewModel> >(cardsList);

            return(cardsListVm);
        }
Пример #2
0
 public async Task <List <CardDto> > Handle(GetAllCardsQuery request, CancellationToken cancellationToken)
 {
     return(_mapper.Map <List <CardDto> >(await this._context.Cards.Find(_ => true).ToListAsync(cancellationToken)));
 }