public async Task <ActionResult <MovieTagViewModel> > PostMovieTag(MovieTagViewModel viewModel)
        {
            try
            {
                var entity = _mapper.Map <MovieTag>(viewModel);
                var model  = await _movieTagRepository.Add(entity);

                return(_mapper.Map <MovieTagViewModel>(model));
            }
            catch (InvalidDataException e)
            {
                return(BadRequest(new { message = e.Message }));
            }
            catch (Exception e)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new { message = e.Message }));
            }
        }
        public async Task <IActionResult> PatchMovieTag(int id, MovieTagViewModel viewModel)
        {
            try
            {
                var entity = _mapper.Map <MovieTag>(viewModel);
                await _movieTagRepository.Update(id, entity);

                return(NoContent());
            }
            catch (MovieTagNotFoundException e)
            {
                return(NotFound(new { message = e.Message }));
            }
            catch (Exception e)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError, new { message = e.Message }));
            }
        }
 private MovieTag GetMapperMovieTagViewModelToMovieTag(MovieTagViewModel viewModel)
 {
     return(_mapper.Map <MovieTag>(viewModel));
 }