public ActionResult Edit(Answer answer) { if (ModelState.IsValid) { db.Entry(answer).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(answer); }
public ActionResult Create(Answer answer) { if (ModelState.IsValid) { db.Answers.Add(answer); db.SaveChanges(); return RedirectToAction("Index"); } return View(answer); }