Skip to content

Instantly share code, notes, and snippets.

@birksy89
Created March 3, 2017 09:42
Show Gist options
  • Save birksy89/734874e0e4e327253da27f9aced22153 to your computer and use it in GitHub Desktop.
Save birksy89/734874e0e4e327253da27f9aced22153 to your computer and use it in GitHub Desktop.
public void getTeams()
{
var json = GET("http://api.football-data.org/v1/competitions/426/teams");
dynamic jsonObj = JsonConvert.DeserializeObject(json);
var tm = new TeamManager();
foreach (var obj in jsonObj.teams)
{
Team aTeam = new Team();
aTeam.name = obj.name;
aTeam.code = obj.code;
aTeam.shortName = obj.shortName;
aTeam.squadMarketValue = obj.squadMarketValue;
aTeam.crestUrl = obj.crestUrl;
tm.CreateTeam(aTeam);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment