public List <UserListResponse> Handle(GetListUsersQuery query) { string sql = @" Select Id, FirstName, LastName, Email From [Identity].[USERS]"; using (SqlConnection connection = new SqlConnection(_connectionString.Value)) { List <UserListResponse> users = connection .Query <UserListResponse>(sql).ToList(); return(users); } }
public async Task <ActionResult <ListResponse <UserViewModel> > > GetAll([FromQuery] GetListUsersQuery query) => Ok(await Mediator.Send(query));
public async Task <List <User> > Handle(GetListUsersQuery request, CancellationToken cancellationToken) { return(await _receiverService.GetUsersAsync(cancellationToken).ConfigureAwait(false)); }
public async Task <IEnumerable <User> > Get(CancellationToken cancellationToken) { var query = new GetListUsersQuery(); return(await _mediator.Send(query, cancellationToken)); }