public IActionResult EditMovie(ResultsMoviesViewModel movie) { var isEdited = false; if (ModelState.IsValid) { var editedMovieDto = this.mapper.MapTo <MovieDto>(movie); isEdited = this.movieService.EditMovie(editedMovieDto); } return(this.Json(new JsonResult(new { isEdited }))); }
public IActionResult CreateMovie(ResultsMoviesViewModel newMovie) { var isCreated = false; if (ModelState.IsValid) { var createdMovieDto = this.mapper.MapTo <MovieDto>(newMovie); isCreated = this.movieService.CreateMovie(createdMovieDto); } return(this.Json(new JsonResult(new { isCreated }))); }