public ActionResult Edit(Session session) { if (ModelState.IsValid) { db.Entry(session).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.SpeakerId = new SelectList(db.Speakers, "SpeakerId", "FullName", session.SpeakerId); return View(session); }
public ActionResult Create(Session session) { if (ModelState.IsValid) { db.Sessions.Add(session); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.SpeakerId = new SelectList(db.Speakers, "SpeakerId", "FullName", session.SpeakerId); return View(session); }