Skip to content

Instantly share code, notes, and snippets.

@pstephens
Forked from timheuer/gist:2309e689a40a20f3e8c9
Last active August 29, 2015 14:00
Show Gist options
  • Save pstephens/1ebd6f3485b7e8bf7357 to your computer and use it in GitHub Desktop.
Save pstephens/1ebd6f3485b7e8bf7357 to your computer and use it in GitHub Desktop.
JSON:
[
{
international_date: false,
is_coed: false,
team_name: "foo bar"
},
{
international_date: false,
is_coed: false,
team_name: "foo bar"
}
]
C# Class:
[JsonObject("team")]
public class Team
{
[JsonProperty("international_date")]
public bool InternationalDate { get; set; }
[JsonProperty("is_coed")]
public bool IsCoed { get; set; }
[JsonProperty("team_name")]
public string TeamName { get; set; }
}
Code:
List<Team> teams = (List<Team>) Newtonsoft.Json.JsonConvert.DeserializeObject<List<Team>>(data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment