public static void AddMatch(Match match) { if (CheckIfMatchExists(match)) throw new InvalidOperationException("Match already exists in the league."); matches.Add(match); }
public static void AddMatch(Match match) { if (CheckIfMatchExists(match)) { throw new InvalidOperationException("Match already exists in that league"); } }
public static void AddMatch(Match match) { if (MatchExists(match)) { throw new InvalidOperationException("This match is already in that league."); } matches.Add(match); }
public static void AddMatch(Match match) { if (CheckIfMatchExists(match)) { throw new InvalidOperationException("Team already exists"); } matches.Add(match); }
public static void AddMatch(Match match) { if (CheckIfMatchExists(match)) { throw new InvalidOperationException("Match is alredy exist at that legue"); } matches.Add(match); }
public static void AddMatch(Match match) { var existMatch = matches.FirstOrDefault(m => m.Id == match.Id); if (existMatch != null) { throw new OperationCanceledException("Cannot add Match with existing id."); } matches.Add(match); }
public static void AddMatches(Match match) { if (MatchExistInLeague(match)) { throw new InvalidOperationException(MsgConstants.TeamAlreadyExists); } matches.Add(match); }
public static bool CheckIfMatchExists(Match match) { return matches.Any(m => m.Id == match.Id); }
private static bool MatchExists(Match match) { return matches.Any(m => m.Id == match.Id); }
private static bool CheckIfMatchExists(Match match) { return matches.Any(p => p.ID == match.ID); }