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); }
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); }