Exemple #1
0
 private static IEnumerable <Standing> GetResultMatchStandings(StandingsResponse leagueTableResult)
 {
     if (!string.IsNullOrEmpty(leagueTableResult?.Error))
     {
         return(new List <Standing>
         {
             new Standing
             {
                 Team = leagueTableResult.Error
             }
         });
     }
     else
     {
         return(leagueTableResult?.Standing?.Select(x => new Standing
         {
             Against = x.GoalsAgainst,
             AwayDraws = x.Away?.Draws ?? -1,
             AwayGoalsAgainst = x.Away?.GoalsAgainst ?? -1,
             AwayGoalsFor = x.Away?.Goals ?? -1,
             AwayLosses = x.Away?.Losses ?? -1,
             AwayWins = x.Away?.Wins ?? -1,
             //CrestURI = x.CrestURI,
             Diff = x.GoalDifference,
             For = x.Goals,
             HomeDraws = x.Home?.Draws ?? -1,
             HomeGoalsAgainst = x.Home?.GoalsAgainst ?? -1,
             HomeGoalsFor = x.Home?.Goals ?? -1,
             HomeLosses = x.Home?.Losses ?? -1,
             HomeWins = x.Home?.Wins ?? -1,
             Played = x.PlayedGames,
             Points = x.Points,
             Rank = x.Position,//full
             //Rank = x.Rank,//minified
             //Team = MapperHelper.MapExternalTeamNameToInternalTeamName(x.Team),//minified
             Team = MapperHelper.MapExternalTeamNameToInternalTeamName(x.TeamName),//full
         }));
     }
 }
Exemple #2
0
 private static IEnumerable <FixtureFuture> GetFixtureFutures(FixturesResponse fixturesResult)
 {
     if (!string.IsNullOrEmpty(fixturesResult?.Error))
     {
         return(new List <FixtureFuture>
         {
             new FixtureFuture
             {
                 HomeName = fixturesResult.Error
             }
         });
     }
     else
     {
         return(fixturesResult?.Fixtures?.Select(x => new FixtureFuture
         {
             AwayName = MapperHelper.MapExternalTeamNameToInternalTeamName(x.AwayTeamName),
             Date = MapperHelper.GetDate(x.Date, Thread.CurrentThread.CurrentCulture),
             HomeName = MapperHelper.MapExternalTeamNameToInternalTeamName(x.HomeTeamName),
             Time = MapperHelper.GetTime(x.Date, Thread.CurrentThread.CurrentCulture),
         }));
     }
 }