示例#1
0
        public ActionResult Create(Movie movies)
        {
            if (ModelState.IsValid)
            {
                db.Movies.Add(movies);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(movies);
        }
示例#2
0
 public ActionResult Edit(Movie movies)
 {
     if (ModelState.IsValid)
     {
         db.Entry(movies).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(movies);
 }