public ActionResult Create([Bind(Include = "Id,Name,Email,Gender,City,GameScore,DateOfBirth")] Gamer gamer) { if (ModelState.IsValid) { db.Gamers.Add(gamer); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(gamer)); }
private void SeedInMemoryStore() { MapperHelper.InitMapperConf(); using (var context = new OnlineGameContext(_options)) { context.Database.EnsureCreated(); context.Games.AddRange(GamesTestData.FirstGame, GamesTestData.ThirdGame, GamesTestData.FourthGame); context.SaveChanges(); } }