public ActionResult Create(Performance performance) { if (ModelState.IsValid) { db.Performances.Add(performance); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.ProductionId = new SelectList(db.Productions, "ProductionId", "Title", performance.ProductionId); return View(performance); }
public ActionResult Edit(Performance performance) { if (ModelState.IsValid) { db.Entry(performance).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.ProductionId = new SelectList(db.Productions, "ProductionId", "Title", performance.ProductionId); return View(performance); }