示例#1
0
 public ActionResult Edit(MovieDB moviedb)
 {
     if (ModelState.IsValid)
     {
         db.Entry(moviedb).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(moviedb);
 }
示例#2
0
        public ActionResult Create(MovieDB moviedb)
        {
            if (ModelState.IsValid)
            {
                db.Movies.Add(moviedb);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(moviedb);
        }