Пример #1
0
 public IEnumerable <Game> AllGames()
 {
     using (var context = new RepositoryDataContext())
     {
         return(context.Games.ToList());
     }
 }
Пример #2
0
 public IEnumerable <NotifyMe> NotifyAll()
 {
     using (var context = new RepositoryDataContext())
     {
         return(context.NotifyMes.ToList());
     }
 }
Пример #3
0
 public IEnumerable <Player> PlayersForGame(int gameId)
 {
     using (var context = new RepositoryDataContext(_connectionString))
     {
         return(context.Players.Where(p => p.GameId == gameId).ToList());
     }
 }
Пример #4
0
 public Game UpcomingGame()
 {
     using (var context = new RepositoryDataContext(_connectionString))
     {
         return(context.Games.FirstOrDefault(g => g.Date > DateTime.Now && g.Date <= DateTime.Now.AddDays(7)));
     }
 }
Пример #5
0
 public void AddNotify(NotifyMe notify)
 {
     using (var context = new RepositoryDataContext(_connectionString))
     {
         context.NotifyMes.InsertOnSubmit(notify);
         context.SubmitChanges();
     }
 }
Пример #6
0
 public void AddGame(Game game)
 {
     using (var context = new RepositoryDataContext(_connectionString))
     {
         context.Games.InsertOnSubmit(game);
         context.SubmitChanges();
     }
 }
Пример #7
0
 public void AddPlayer(Player player)
 {
     using (var context = new RepositoryDataContext(_connectionString))
     {
         context.Players.InsertOnSubmit(player);
         context.SubmitChanges();
     }
 }