public IEnumerable <Game> AllGames() { using (var context = new RepositoryDataContext()) { return(context.Games.ToList()); } }
public IEnumerable <NotifyMe> NotifyAll() { using (var context = new RepositoryDataContext()) { return(context.NotifyMes.ToList()); } }
public IEnumerable <Player> PlayersForGame(int gameId) { using (var context = new RepositoryDataContext(_connectionString)) { return(context.Players.Where(p => p.GameId == gameId).ToList()); } }
public Game UpcomingGame() { using (var context = new RepositoryDataContext(_connectionString)) { return(context.Games.FirstOrDefault(g => g.Date > DateTime.Now && g.Date <= DateTime.Now.AddDays(7))); } }
public void AddNotify(NotifyMe notify) { using (var context = new RepositoryDataContext(_connectionString)) { context.NotifyMes.InsertOnSubmit(notify); context.SubmitChanges(); } }
public void AddGame(Game game) { using (var context = new RepositoryDataContext(_connectionString)) { context.Games.InsertOnSubmit(game); context.SubmitChanges(); } }
public void AddPlayer(Player player) { using (var context = new RepositoryDataContext(_connectionString)) { context.Players.InsertOnSubmit(player); context.SubmitChanges(); } }