示例#1
0
        public static Videogames GetGameByString(string dataSeach)
        {
            Videogames game = null;

            try
            {
                GameContext context = new GameContext();
                game = context.Videogames.Where(x => x.name.Contains(dataSeach)).SingleOrDefault();
            }
            catch (Exception)
            {
                throw;
            }
            return(game);
        }
示例#2
0
        public static Videogames GetGame(int id)
        {
            Videogames game = null;

            try
            {
                GameContext context = new GameContext();
                game = context.Videogames.Where(x => x.id == id).SingleOrDefault();
            }
            catch (Exception)
            {
                throw;
            }
            return(game);
        }