Esempio n. 1
0
        public ActionResult Create(Menu collection)
        {
            try
            {
               if(ModelState.IsValid)
               {
                   _menurepo.Add(collection);
                   _menurepo.Save();

               }
               else
               {
                   //Validation Error
                   return View();
               }

                return RedirectToAction("Index");
            }
            catch
            {
                return View();
            }
        }
Esempio n. 2
0
 public void Add(Menu menu)
 {
     GCContext.Menus.Add(menu);
 }