public ActionResult Create(Movie movie) { if (ModelState.IsValid) { _repo.Add<Movie>(movie); _repo.SaveChanges(); return RedirectToAction("Index"); } return View(); }
public ActionResult Edit(Movie movie) { if (ModelState.IsValid) { var originalMovie = _repo.Find<Movie>(movie.Id); originalMovie.Title = movie.Title; originalMovie.Director = movie.Director; _repo.SaveChanges(); return RedirectToAction("Index"); } return View(); }