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(); }
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); } } }
internal static void AddMatches(IEnumerable <Match> matches) { var matchService = new MatchService(); matchService.Add(matches); }
internal static Match FindMatchById(Guid id) { var matchService = new MatchService(); return(matchService.FindById(id)); }
internal static IEnumerable <Match> GetAllMatches() { var matchService = new MatchService(); return(matchService.GetAll().ToList()); }