예제 #1
0
        public ActionResult Create(MenuModel menumodel)
        {
            if (ModelState.IsValid)
            {
                db.Menus.Add(menumodel);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(menumodel);
        }
예제 #2
0
 public ActionResult Edit(MenuModel menumodel)
 {
     if (ModelState.IsValid)
     {
         db.Entry(menumodel).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(menumodel);
 }