public void DistributeScores(Match match, Team team) { if (match.AwayTeamScore > match.HomeTeamScore && match.Status == MatchStatus.finished) { team.Scores += 2; _context.SaveChanges(); } else if (match.HomeTeamScore > match.AwayTeamScore && match.Status == MatchStatus.finished) { team.Scores += 2; _context.SaveChanges(); } else if (match.HomeTeamScore == match.AwayTeamScore && match.Status == MatchStatus.finished) { team.Scores += 1; _context.SaveChanges(); } }
public virtual void Save() { _context.SaveChanges(); }