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

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