public ProductController() { GameStoreDbContext context = new GameStoreDbContext(); ProductManager = new ProductManager(context); PegiManager = new PegiManager(context); MultimediaManager = new MultimediaManager(context); }
public IActionResult Edit(int id) { using (var db = new GameStoreDbContext()) { var idOdGame = db.Games.Find(id); return(this.View(idOdGame)); } }
public IActionResult Delete(int id) { using (var db = new GameStoreDbContext()) { var idOfGame = db.Games.Find(id); return(View(idOfGame)); } }
public void AddRange(IEnumerable <UserGame> userGames) { using (var db = new GameStoreDbContext()) { db.AddRange(userGames); db.SaveChanges(); } }
public IActionResult Index() { using (var db = new GameStoreDbContext()) { var game = db.Games.ToList(); return(this.View(game)); } }
public IActionResult Edit(int id) { using (var db = new GameStoreDbContext()) { var gameToEdit = db.Games.Find(id); return(View(gameToEdit)); } }
public IActionResult Index() { using (var db = new GameStoreDbContext()) { var allGames = db.Games.ToList(); return(View(allGames)); } }
public bool Find(string email, string password) { string passwordHash = PasswordUtilities.GenerateHash(password); using (var db = new GameStoreDbContext()) { return(db.Users.Any(x => x.Email == email && x.PasswordHash == passwordHash)); } }
static StartUp() { using (GameStoreDbContext database = new GameStoreDbContext()) { database.Database.Migrate(); } AutoMapperConfiguration.Initialize(); }
public bool IsAdmin(string email) { using (var db = new GameStoreDbContext()) { return(db .Users .Any(x => x.Email == email && x.IsAdmin == true)); } }
public bool Find(LoginViewModel model) { using (var db = new GameStoreDbContext()) { return(db .Users .Any(x => x.Email == model.Email && x.Password == model.Password)); } }
public IActionResult Edit(Game game) { using (var db = new GameStoreDbContext()) { db.Games.Update(game); db.SaveChanges(); } return(RedirectToAction("Index")); }
public int?GetGameId(string title) { using (var db = new GameStoreDbContext()) { var game = db.Games.FirstOrDefault(g => g.Title == title); return(game?.Id); } }
public DbSynchronizer(GameStoreDbContext gameStoreDbContext, NorthwindDbContext northwindDbContext) { _gameStoreDbContext = gameStoreDbContext; _northwindDbContext = northwindDbContext; InitEntitiesSynchronizers(); InitCleaners(); InitNavigationPropertiesSynchronizers(); }
public void AddGame(int id) { using (var db = new GameStoreDbContext()) { var game = db.Games.SingleOrDefault(x => x.Id == id); this.Games.Add(game); } }
public void InitializeDatabase() { Console.WriteLine("Initializing database..."); using (var context = new GameStoreDbContext()) { context.Database.Migrate(); } }
private static void ConfigureDatabase() { var dbContext = new GameStoreDbContext(); using (dbContext) { dbContext.Database.Migrate(); } }
public void Delete(int id) { using (var db = new GameStoreDbContext()) { var game = db.Games.FirstOrDefault(g => g.Id == id); db.Games.Remove(game); db.SaveChanges(); } }
public bool IsAdmin(string email) { using (var db = new GameStoreDbContext()) { return(db.Users .FirstOrDefault(u => u.Email.ToLower() == email.ToLower()) .IsAdmin); } }
public void Delete(int id) { using (var db = new GameStoreDbContext()) { var game = db.Games.Find(id); db.Games.Remove(game); db.SaveChanges(); } }
public Game FindById(int id) { using (var db = new GameStoreDbContext()) { var game = db.Games.Find(id); return(game); } }
public bool IsExist(int id) { using (var db = new GameStoreDbContext()) { return(db .Games .Any(x => x.Id == id)); } }
public bool UserExists(string email, string password) { using (var db = new GameStoreDbContext()) { return(db .Users .Any(u => u.Email == email && u.Password == password)); } }
public void InitializeDatabase() { Console.WriteLine("Initializing database..."); using (var context = new GameStoreDbContext()) { context.Database.Migrate();// in EF the Migration has been automatic } }
public bool IsAdmin(string email) { using (var db = new GameStoreDbContext()) { return(db .Users .Any(u => u.Email == email && u.IsAdmin)); } }
public Game GetGameByGivenId(int id) { using (var db = new GameStoreDbContext()) { var game = db.Games.SingleOrDefault(x => x.Id == id); return(game); } }
static Launcher() { using (var context = new GameStoreDbContext()) { context.Database.Migrate(); } AutoMapperConfiguration.Initialize(); }
public IActionResult Delete(Game game) { using (var db = new GameStoreDbContext()) { db.Remove(game); db.SaveChanges(); } return(RedirectToAction("Index")); }
public User FindByEmail(string email) { using (var db = new GameStoreDbContext()) { return(db.Users .Include(x => x.Games) .ThenInclude(x => x.Game) .FirstOrDefault(x => x.Email == email)); } }
public void DeleteGameFromDbByGivenId(int id) { using (var db = new GameStoreDbContext()) { var game = db.Games.SingleOrDefault(x => x.Id == id); db.Games.Remove(game); db.SaveChanges(); } }
public Game Find(int id) { using (GameStoreDbContext dbContext = new GameStoreDbContext()) { return(dbContext .Games .Where(g => g.Id == id) .FirstOrDefault()); } }
public ProductManager(GameStoreDbContext context) : base(context) { }
public OrderManager(GameStoreDbContext context) : base(context) { }
public PegiManager(GameStoreDbContext context) : base(context) { }
public Manager(GameStoreDbContext context) { Context = context; }
public OrderController() { GameStoreDbContext context = new GameStoreDbContext(); AccountManager = new AccountManager(context); OrderManager = new OrderManager(context); }
public OpinionController() { GameStoreDbContext context = new GameStoreDbContext(); OpinionManager = new OpinionManager(context); ProductManager = new ProductManager(context); }
public AccountController() { GameStoreDbContext context = new GameStoreDbContext(); AccountManager = new AccountManager(context); }
public PegiController() { GameStoreDbContext context = new GameStoreDbContext(); PegiManager = new PegiManager(context); }
public OpinionManager(GameStoreDbContext context) : base(context) { }
public ArticleController() { GameStoreDbContext context = new GameStoreDbContext(); ArticleManager = new ArticleManager(context); }
public ArticleManager(GameStoreDbContext context) : base(context) { }
public MultimediaManager(GameStoreDbContext context) : base(context) { }
public HomeController() { GameStoreDbContext context = new GameStoreDbContext(); ProductManager = new ProductManager(context); }
public AccountManager(GameStoreDbContext context) : base(context) { }