Exemple #1
0
 public Match(Team homeTeam, Team awayTeam, Score score, int id)
 {
     this.HomeTeam = homeTeam;
     this.AwayTeam = awayTeam;
     this.Score = score;
     this.ID = id;
 }
Exemple #2
0
 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;
 }
Exemple #3
0
        public static void AddTeam(Team team)
        {
            if (CheckIfTeamExists(team))
            {
                throw new InvalidOperationException("This team is already in this league");
            }

            teams.Add(team);
        }
Exemple #4
0
 private static bool CheckIfTeamExists(Team team)
 {
     return teams.Any(t => t.Name == team.Name);
 }