コード例 #1
0
        internal static void SaveAll()
        {
            var teamService   = new TeamService();
            var playerService = new PlayerService();
            var seriesService = new SeriesService();
            var matchService  = new MatchService();
            var gameService   = new GameService();

            teamService.Save();
            playerService.Save();
            seriesService.Save();
            matchService.Save();
            gameService.Save();
        }
コード例 #2
0
        internal static void RemoveGameAndMatchesFromSeries(Guid seriesId)
        {
            var series       = FindSeriesById(seriesId);
            var matchService = new MatchService();
            var gameService  = new GameService();
            var allGames     = gameService.GetAll().ToList();

            foreach (var match in series.Schedule)
            {
                matchService.RemoveMatch(match.Id);

                if (allGames.Find(x => x.MatchId == match.Id) != null)
                {
                    gameService.RemoveGame(allGames.Find(x => x.MatchId == match.Id).Id);
                }
            }
        }
コード例 #3
0
        internal static void AddMatches(IEnumerable <Match> matches)
        {
            var matchService = new MatchService();

            matchService.Add(matches);
        }
コード例 #4
0
        internal static Match FindMatchById(Guid id)
        {
            var matchService = new MatchService();

            return(matchService.FindById(id));
        }
コード例 #5
0
        internal static IEnumerable <Match> GetAllMatches()
        {
            var matchService = new MatchService();

            return(matchService.GetAll().ToList());
        }