Skip to content

Instantly share code, notes, and snippets.

@Mirch
Last active January 12, 2019 21:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Mirch/c7ac29af2f87baae6a94763937dcb95f to your computer and use it in GitHub Desktop.
Save Mirch/c7ac29af2f87baae6a94763937dcb95f to your computer and use it in GitHub Desktop.
@inject HttpClient Http
@functions {
IEnumerable<FeedElement> posts;
private async Task<IEnumerable<FeedElement>> GetData()
{
var data = await Http.GetJsonAsync<IEnumerable<FeedElement>>("sample-data/feed.json");
return data;
}
public class FeedElement
{
public string Title { get; set; }
public string Content { get; set; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment