public async Task <IActionResult> Create(MovieViewModel movie) { if (!ModelState.IsValid) { return(View(movie)); } var movieEntity = movie.Adapt <Movie>(); await _repo.CreateMovieAsync(movieEntity); return(RedirectToAction(nameof(Index))); }
public async Task <IActionResult> Create(MovieViewModel movie) { if (!ModelState.IsValid) { return(View(movie)); } var movieEntity = movie.Adapt <Movie>(); await _repo.CreateMovieAsync(movieEntity); return(RedirectToAction(nameof(Index))); }