Exemplo n.º 1
0
 public IEnumerable <Game> AllGames()
 {
     using (var context = new RepositoryDataContext())
     {
         return(context.Games.ToList());
     }
 }
Exemplo n.º 2
0
 public IEnumerable <NotifyMe> NotifyAll()
 {
     using (var context = new RepositoryDataContext())
     {
         return(context.NotifyMes.ToList());
     }
 }
Exemplo n.º 3
0
 public IEnumerable <Player> PlayersForGame(int gameId)
 {
     using (var context = new RepositoryDataContext(_connectionString))
     {
         return(context.Players.Where(p => p.GameId == gameId).ToList());
     }
 }
Exemplo n.º 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)));
     }
 }
Exemplo n.º 5
0
 public void AddNotify(NotifyMe notify)
 {
     using (var context = new RepositoryDataContext(_connectionString))
     {
         context.NotifyMes.InsertOnSubmit(notify);
         context.SubmitChanges();
     }
 }
Exemplo n.º 6
0
 public void AddGame(Game game)
 {
     using (var context = new RepositoryDataContext(_connectionString))
     {
         context.Games.InsertOnSubmit(game);
         context.SubmitChanges();
     }
 }
Exemplo n.º 7
0
 public void AddPlayer(Player player)
 {
     using (var context = new RepositoryDataContext(_connectionString))
     {
         context.Players.InsertOnSubmit(player);
         context.SubmitChanges();
     }
 }