public Match(Team homeTeam, Team awayTeam, Score score, int id) { this.HomeTeam = homeTeam; this.AwayTeam = awayTeam; this.Score = score; this.ID = id; }
public Player(string firstName, string lastName, decimal salary, DateTime dateOfBirth, Team team) { this.FirstName = firstName; this.LastName = lastName; this.Salary = salary; this.DateOfBirth = dateOfBirth; this.Team = team; }
public static void AddTeam(Team team) { if (CheckIfTeamExists(team)) { throw new InvalidOperationException("This team is already in this league"); } teams.Add(team); }
private static bool CheckIfTeamExists(Team team) { return teams.Any(t => t.Name == team.Name); }