internal IList<Match> FromLeaguesMatches(LeaguesMatchesResponse apiData) { List<Match> ret = new List<Match>(); foreach (var apiMatch in apiData.Fixtures) { var x = new Match(); var temp = apiMatch.Links.Self.Href.Split('/'); x.ApiId = Int32.Parse(temp[temp.Length - 1]); x.HomeTeam = new Team { Name = apiMatch.HomeTeamName }; x.AwayTeam = new Team { Name = apiMatch.AwayTeamName }; x.AwayTeamScore = apiMatch.Result.GoalsAwayTeam; x.HomeTeamScore = apiMatch.Result.GoalsHomeTeam; x.Date = DateTime.Parse(apiMatch.Date, null, System.Globalization.DateTimeStyles.RoundtripKind); ret.Add(x); } return ret; }
internal IList <Match> FromLeaguesMatches(LeaguesMatchesResponse apiData) { List <Match> ret = new List <Match>(); foreach (var apiMatch in apiData.Fixtures) { var x = new Match(); var temp = apiMatch.Links.Self.Href.Split('/'); x.ApiId = Int32.Parse(temp[temp.Length - 1]); x.HomeTeam = new Team { Name = apiMatch.HomeTeamName }; x.AwayTeam = new Team { Name = apiMatch.AwayTeamName }; x.AwayTeamScore = apiMatch.Result.GoalsAwayTeam; x.HomeTeamScore = apiMatch.Result.GoalsHomeTeam; x.Date = DateTime.Parse(apiMatch.Date, null, System.Globalization.DateTimeStyles.RoundtripKind); ret.Add(x); } return(ret); }