public ActionResult Edit(Poll poll) { if (ModelState.IsValid) { db.Entry(poll).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return RedirectToAction("Details", poll.PollId); }
public ActionResult Create(Poll poll) { if (ModelState.IsValid) { db.Polls.Add(poll); db.SaveChanges(); return RedirectToAction("Index"); } return View(poll); }