public async Task <ActionResult <MovieDomainModel> > Activate(Guid id) { var movie = await _movieService.GetMovieByIdAsync(id); if (movie == null) { ErrorResponseModel errorResponse = new ErrorResponseModel { ErrorMessage = Messages.MOVIE_DOES_NOT_EXIST, StatusCode = System.Net.HttpStatusCode.BadRequest, }; return(BadRequest(errorResponse)); } MovieResultModel activated; try { activated = await _movieService.ActivateMovie(id); } catch (DbUpdateException e) { ErrorResponseModel errorResponse = new ErrorResponseModel { ErrorMessage = e.InnerException.Message ?? e.Message, StatusCode = System.Net.HttpStatusCode.BadRequest }; return(BadRequest(errorResponse)); } return(Accepted("movies//" + activated.Movie.Id, activated.Movie)); }