public string Get() { Task <string> task = JsonLibrary.GetJsonAsync(new Uri("https://jsonplaceholder.typicode.com/posts/1")); var taskResult = task.Result; //block main thread // context return(taskResult); }
public async Task <string> Get() { string value = await JsonLibrary.GetJsonAsync(new Uri("https://jsonplaceholder.typicode.com/posts/1")); return(value); }