public ActionResult Create(Movie movie) { if (ModelState.IsValid) { db.Movies.Add(movie); db.SaveChanges(); return RedirectToAction("Index"); } else return View(movie); }
public ActionResult List2(Movie mov) { if (ModelState.IsValid) { db.Movies.Add(mov); db.SaveChanges(); } return RedirectToAction("Index"); }
public ActionResult Edit(Movie movie) { if (ModelState.IsValid) { db.Entry(movie).State = EntityState.Modified; db.SaveChanges(); return RedirectToAction("Index"); } return View(movie); }