Getting item from json deserialized list [beginner]

What I'm trying to do is output the items from the list of the RootObject "public List<BannedChampion> bannedChampions { get; set; }", but I honeslty don't know how to access them, for non-list items it'd be fairly simple but I'm stuck at the lists

WebClient client = new WebClient();

 string jsonData = client.DownloadString("http://ift.tt/1F7zgnz;); string content = @"" + jsonData + ""; Sightstone.CurrentGame.RootObject game = JsonConvert.DeserializeObject<Sightstone.CurrentGame.RootObject>(content); testBox.Text = ??? 

//classes

public class Rune { public int count { get; set; } public int runeId { get; set; } }

 public class Mastery { public int rank { get; set; } public int masteryId { get; set; } } public class Participant { public int teamId { get; set; } public int spell1Id { get; set; } public int spell2Id { get; set; } public int championId { get; set; } public int profileIconId { get; set; } public string summonerName { get; set; } public bool bot { get; set; } public int summonerId { get; set; } public List<Rune> runes { get; set; } public List<Mastery> masteries { get; set; } } public class Observers { public string encryptionKey { get; set; } } public class BannedChampion { public int championId { get; set; } public int teamId { get; set; } public int pickTurn { get; set; } } public class RootObject { public int gameId { get; set; } public int mapId { get; set; } public string gameMode { get; set; } public string gameType { get; set; } public int gameQueueConfigId { get; set; } public List<Participant> participants { get; set; } public Observers observers { get; set; } public string platformId { get; set; } public List<BannedChampion> bannedChampions { get; set; } public long gameStartTime { get; set; } public int gameLength { get; set; } } 

by playhardgopro via /r/csharp

Leave a Reply