public ActionResult <MovieDto> PostMovie([FromBody] PostMovieDto movieCreate) { var movie = movieCreate.AsMovie(); try { _movieRepository.AddMovie(movie); } catch { return(BadRequest()); } // A new movie was successfully created, you can get that movie back by sending the movie id to the action method GetMovie return(CreatedAtAction(nameof(GetMovie), new { id = movie.Id }, movie.AsDto())); }