public Match(int id, Team homeTeam, Team awayTeam, Score score) { this.ID = id; this.HomeTeam = homeTeam; this.AwayTeam = awayTeam; this.Score = score; }
private static void AddTeam(string teamName, string teamNickName, DateTime teamFoundationDate) { Team currentTeam = new Team(teamName, teamNickName, teamFoundationDate); League.AddTeam(currentTeam); Console.WriteLine("Team successfully added!"); }
public static void AddTeam(Team currentTeam) { if (TeamExists(currentTeam)) { throw new InvalidOperationException("Team already exists in the league!"); } teams.Add(currentTeam); }
private static bool TeamExists(Team currentTeam) { bool teamExists = Teams.Any(x => x.Name.Equals(currentTeam.Name)); return teamExists; }