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