public Standings(NewStandings ns) { has_next = ns.new_entries.has_next; number = ns.new_entries.number; standings = new StandingsList(); standings.results = new List <Standing>(); foreach (var nr in ns.new_entries.results) { Standing standing = new Standing(); standing.entry = nr.entry; standing.id = nr.id; standing.player_name = nr.player_first_name + " " + nr.player_last_name; standing.entry_name = nr.entry_name; standings.results.Add(standing); } }
private async Task <Standings> readStandings(int leagueId) { var request = _generator.GenerateLeagueH2hStandingsRequest(leagueId); try { var standingsString = await _executor.Execute(request); return(JsonConvert.DeserializeObject <Standings>(standingsString, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore })); } catch (Exception ex) { NewStandings newStandings = await _executor.Execute <NewStandings>(request); _log.Error(ex); return(new Standings(newStandings)); } }