public IQueryable<Game> getGame([QueryString("id")] int? gameId)
 {
     var db = new GameContext();
     IQueryable<Game> query = db.Games;
     if(gameId.HasValue && gameId > 0)
     {
         query = query.Where(g => g.GameID == gameId);
     }
     else
     {
         query = null;
     }
     return query;
 }
Exemple #2
0
 public IQueryable<Game> GetGames()
 {
     var _db = new InternetGameDatabase.Models.GameContext();
     IQueryable<Game> gameQuery = _db.Games;
     return gameQuery;
 }