public void GetUser() { Console.WriteLine("GetUser start"); IJsonPlaceHolder client = new JsonPlaceHolder(); for (int i = 1; i < 5; i++) { User user = client.GetUserAsync(i).Result; Console.WriteLine(user); } Console.WriteLine("GetUser finish"); }
public void GetAllUsers() { Console.WriteLine("GetAllUsers start"); IJsonPlaceHolder client = new JsonPlaceHolder(); User[] users = client.GetUserAsync().Result; Console.WriteLine($"{users.Length} posts found"); foreach (var item in users) { Console.WriteLine(item); } Console.WriteLine("GetAllUsers finish"); }