public static void AddMatch(Match match) { if (CheckIfMatchExists(match)) { throw new InvalidOperationException("This match already exists in this league"); } matches.Add(match); }
private static bool CheckIfMatchExists(Match match) { return matches.Any(m => m.ID == match.ID); }