示例#1
0
        public static IEnumerable <Game> GetGames()
        {
            var gameDB = new myGamesDBEntities();
            var query  = from games in gameDB.Games
                         select games;

            return(query.ToList());
        }
示例#2
0
        public static void InsertGame(Game game)
        {
            var gameDB = new myGamesDBEntities();

            if (game.Name != null)
            {
                gameDB.Games.Add(game);
                gameDB.SaveChanges();
            }
        }