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