示例#1
0
        public ActionResult Create(Page page)
        {
            if (ModelState.IsValid)
            {
                db.Pages.Add(page);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(page);
        }
示例#2
0
 public ActionResult Edit(Page page)
 {
     if (ModelState.IsValid)
     {
         db.Entry(page).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(page);
 }