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