public ActionResult Create(Question question) { if (ModelState.IsValid) { db.Questions.Add(question); db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.partyID = new SelectList(db.Parties, "ID", "title", question.partyID); return View(question); }
public ActionResult Edit(Question question) { if (ModelState.IsValid) { db.Entry(question).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } ViewBag.partyID = new SelectList(db.Parties, "ID", "title", question.partyID); return View(question); }