private static async Task GetUserById(int userId, User.UserClient userServiceClient) { var jwt = await GetJwt(); var headers = new Metadata { { "Authorization", $"Bearer {jwt}" } }; var getUserByIdViewModel = new GetUserByIdViewModel { UserId = userId, }; try { var user = userServiceClient.GetUser(getUserByIdViewModel, headers); Console.WriteLine($"{user.Id} - {user.FirstName} {user.Surname} - {user.EmailAddress}"); } catch (RpcException ex) { Console.WriteLine($"{ex.Status.StatusCode} - {ex.Status.Detail}"); } }
public UserReply GetUserAsync(int id) { return(_userClient.GetUser(new IdRequest { Id = id })); }