예제 #1
0
 public async Task <List <AmigoDto> > Handle(GetAmigosQuery request, CancellationToken cancellationToken)
 {
     return(await _context.Amigos
            .OrderBy(x => x.Nome)
            .ProjectTo <AmigoDto>(_mapper.ConfigurationProvider)
            .ToListAsync(cancellationToken));
 }
예제 #2
0
 public async Task <ActionResult <List <AmigoDto> > > GetAmigos([FromQuery] GetAmigosQuery query)
 {
     return(await Mediator.Send(query));
 }