-
-
Save pstephens/1ebd6f3485b7e8bf7357 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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