public ActionResult Create(StageModel stagemodel) { if (ModelState.IsValid) { db.StageModels.Add(stagemodel); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.GameId = new SelectList(db.GameModels, "GameId", "Name", stagemodel.GameId); return View(stagemodel); }
public ActionResult Edit(StageModel stagemodel) { if (ModelState.IsValid) { db.Entry(stagemodel).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.GameId = new SelectList(db.GameModels, "GameId", "Name", stagemodel.GameId); return View(stagemodel); }