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