Пример #1
0
        public static void AddMatch(Match match)
        {
            if (CheckIfMatchExists(match))
                throw new InvalidOperationException("Match already exists in the league.");

            matches.Add(match);
        }
Пример #2
0
 public static void AddMatch(Match match)
 {
     if (CheckIfMatchExists(match))
     {
         throw new InvalidOperationException("Match already exists in that league");
     }
 }
Пример #3
0
 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);
 }
Пример #5
0
Файл: League.cs Проект: T316/OOP
        public static void AddMatch(Match match)
        {
            if (CheckIfMatchExists(match))
            {
                throw new InvalidOperationException("Match is alredy exist at that legue");
            }

            matches.Add(match);
        }
Пример #6
0
 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);
 }
Пример #7
0
        public static void AddMatches(Match match)
        {
            if (MatchExistInLeague(match))
            {
                throw new InvalidOperationException(MsgConstants.TeamAlreadyExists);
            }

            matches.Add(match);
        }
Пример #8
0
Файл: League.cs Проект: T316/OOP
 public static bool CheckIfMatchExists(Match match)
 {
     return matches.Any(m => m.Id == match.Id);
 }
Пример #9
0
 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);
 }