Last active
February 29, 2016 14:18
-
-
Save NicoVermeir/5e899755969f678b5b5e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private async Task FetchData() | |
{ | |
var service = new ResourcesService(); | |
var result = await service.FetchAllResources(); | |
//textblock is bound against Json | |
Json = result | |
} | |
public class ResourcesService | |
{ | |
public async Task<string> FetchAllResources() | |
{ | |
var client = RestClient.GetClientInstance(); | |
var result = await client.GetAsync(Constants.ApiCallUrl).ConfigureAwait(false); | |
string json = await result.Content.ReadAsStringAsync().ConfigureAwait(false); | |
return json; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment