public static void AddTeam(Team team) { if (CheckIfTeamExists(team)) { throw new InvalidOperationException("Team already exists in that league"); } }
public static void AddTeam(Team team) { if (CheckIfTeamExists(team)) throw new InvalidOperationException("Team already exists in this league."); teams.Add(team); }
public Match(int id,Team homeTeam,Team awayTeam,Score score) { this.Id = id; this.HomeTeam = homeTeam; this.AwayTeam = awayTeam; this.Score = score; }
public Match(Team homeTeam, Team awayTeam, Score score) { this.checkTeams = this.CheckTeams(homeTeam, awayTeam); this.HomeTeam = homeTeam; this.AwayTeam = awayTeam; this.Score = score; }
public static void AddTeam(Team team) { if (CheckIfTeamExists(team)) { throw new InvalidOperationException("Team already exists"); } teams.Add(team); }
public static void AddTeam(Team team) { if (TeamExists(team)) { throw new InvalidOperationException("This team is already in that league."); } teams.Add(team); }
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 (TeamExistInLeague(team)) { throw new InvalidOperationException(MsgConstants.TeamAlreadyExists); } teams.Add(team); }
public static void AddTeam(Team team) { var existTeam = teams.FirstOrDefault(m => m.Name == team.Name); if (existTeam != null) { throw new OperationCanceledException("Cannot add Team with the same name."); } teams.Add(team); }
public Match(Team homeTeam, Team awayTeam, Score score, int id) { if (homeTeam.Name == awayTeam.Name) { throw new ArgumentException(MsgConstants.TeamsShouldBeDifferent); } this.HomeTeam = homeTeam; this.AwayTeam = awayTeam; this.MatchScore = score; this.Id = id; }
public Match(int id,Team homTeam,Team awayTeam) : this(id,homTeam,awayTeam,null) { }
public static bool CheckIfTeamExists(Team team) { return teams.Any(t => t.Name == team.Name); }
private static bool TeamExists(Team team) { return teams.Any(t => t.Name == team.Name); }
private static bool CheckIfTeamExists(Team team) { return teams.Any(p => p.Name == team.Name); }
private bool CheckTeams(Team homeTeam, Team awayTeam) { return homeTeam.Name == awayTeam.Name; }
private static void AddTeam(Team newTeam) { League.AddTeam(newTeam); Console.WriteLine("The {0} has been added successfully", newTeam.Name); }
public Match(Team homeTeam, Team awayTeam) : this(homeTeam, awayTeam, null) { }
public Match(Team homeTeam, Team awayTeam, Score score) { this.HomeTeam = homeTeam; this.AwayTeam = awayTeam; this.Score = score; }