public ActionResult Create(Movie newMovie) { if (ModelState.IsValid) { _moviesService.Add(newMovie); return RedirectToAction("Details", new { id = newMovie.ID }); } else { return View(newMovie); } }
public ActionResult Create(string Title, string fill) { Movie newMovie; if(fill != null) { newMovie = _moviesService.Search(Title); ModelState.Remove("Title"); return View(newMovie); } TryUpdateModel(newMovie = new Movie()); if (ModelState.IsValid) { _moviesService.Add(newMovie); return RedirectToAction("Details", new { id = newMovie.ID }); } else { return View(newMovie); } }