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