コード例 #1
0
        public ActionResult Create(Show show)
        {
            if (ModelState.IsValid)
            {
                db.Shows.Add(show);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(show);
        }
コード例 #2
0
 public ActionResult Edit(Show show)
 {
     if (ModelState.IsValid)
     {
         db.Entry(show).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(show);
 }