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