public static void assignDefaultStats(TeamTournamentStat homeStats, TeamTournamentStat awayStats, Result result) { homeStats.gamesPlayed++; homeStats.goalsFor += result.homeGoals; homeStats.goalsAgainst += result.awayaGoals; homeStats.getGoalDiff(); awayStats.gamesPlayed++; awayStats.goalsFor += result.awayaGoals; awayStats.goalsAgainst += result.homeGoals; awayStats.getGoalDiff(); PopulateGamesWon(homeStats, awayStats, result); }
public static void assignDefaultStats(string tournamentName, Team homeTeam, Team awayTeam, Result result, ApplicationDbContext db) { TeamTournamentStat homeStats = db.teamTournamentStats.ToList().First(x => x.teamId == homeTeam.id && x.tournamentName == tournamentName); TeamTournamentStat awayStats = db.teamTournamentStats.ToList().First(x => x.teamId == awayTeam.id && x.tournamentName == tournamentName); homeStats.gamesPlayed++; homeStats.goalsFor += result.homeGoals; homeStats.goalsAgainst += result.awayaGoals; homeStats.getGoalDiff(); awayStats.gamesPlayed++; awayStats.goalsFor += result.awayaGoals; awayStats.goalsAgainst += result.homeGoals; awayStats.getGoalDiff(); PopulateGamesWon(homeStats, awayStats, result, db); }