Esempio n. 1
0
        public ActionResult Create(Custom custom)
        {
            if (ModelState.IsValid)
            {
                db.Customs.Add(custom);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(custom);
        }
Esempio n. 2
0
 public ActionResult Edit(Custom custom)
 {
     if (ModelState.IsValid)
     {
         db.Entry(custom).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(custom);
 }