public void Deserialize(string json) { JsonArray array = JsonArray.Parse(json); foreach (var item in array) { try { Channel channel = JsonSerializer.Deserialize<Channel>(item.Stringify(), true); Channels.Add(channel); } catch { Recommendation recom = JsonSerializer.Deserialize<Recommendation>(item.Stringify()); Recommendation = recom; } } }
public ChannelList() { Channels = new List<Channel>(); Recommendation = new Recommendation(); }