public async Task <IActionResult> GetAll() { var getAllPeopleCommand = new GetAllPeopleCommand(); var user = await _userManagerWrapper.FindByNameAsync(User.Identity.Name); getAllPeopleCommand.UserId = user.Id; var sendOptions = new SendOptions(); sendOptions.SetDestination("LifeManager.People"); var response = await _endpointInstance.Request <GetResponse>(getAllPeopleCommand, sendOptions).ConfigureAwait(false); return(Ok(new { Response = response.People })); }
public async Task Handle(GetAllPeopleCommand message, IMessageHandlerContext context) { var people = await _peopleService.GetAllPeople(message.UserId); await context.Reply(new GetResponse { People = people }); }