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