public async Task UpdateMovie(int userId, MovieUpdateRequest request)
        {
            var response = await _movieRankRepository.GetMovie(userId, request.MovieName);

            var movieDb = _mapper.ToMovieDbModel(userId, response, request);
            await _movieRankRepository.UpdateMovie(movieDb);
        }
Ejemplo n.º 2
0
        public async Task UpdateMovie(int userId, MovieUpdateRequest movieUpdateRequest)
        {
            var movieResponse = await GetMovie(userId, movieUpdateRequest.MovieName);

            var documentModel = _map.ToDocumentModel(userId, movieResponse, movieUpdateRequest);

            await _movieRankRepository.UpdateMovie(documentModel);
        }
Ejemplo n.º 3
0
        public async Task UpdateMovie(int userId, MovieUpdateRequest updateRequest)
        {
            var movieDb = await _repository.GetMovie(userId, updateRequest.MovieName);

            if (movieDb != null)
            {
                var movieToBeUpdated = _mapper.ToMovieDbModel(userId, movieDb, updateRequest);
                await _repository.UpdateMovie(movieToBeUpdated);
            }
        }
Ejemplo n.º 4
0
 public async Task UpdateMovie(int userId, MovieUpdateRequest request)
 {
     /*
      * var response = await GetMovie(userId, request.MovieName);
      *
      * //var movieDb = _map.ToMovieDbModel(userId, response, request);
      * var movieDb = _map.ToDocumentModel(userId, response, request);
      *
      * await _movieRankRepository.UpdateMovie(movieDb);
      */
     await _movieRankRepository.UpdateMovie(userId, request);
 }
Ejemplo n.º 5
0
        public async Task UpdateMovie(int userId, string movieName, MovieUpdateRankingRequest movieUpdateRankingRequest,
                                      CancellationToken cancellationToken)
        {
            var movieResponse = await _movieRankRepository.GetMovie(userId, movieName, cancellationToken);

            if (movieResponse == null)
            {
                throw new InvalidOperationException($"Invalid userId/MovieName : {userId}/{movieName}");
            }

            var movieUpdateRequest = new MovieUpdateRequest
            {
                Ranking   = movieUpdateRankingRequest.Ranking,
                MovieName = movieName
            };
            await _movieRankRepository.UpdateMovie(userId, movieUpdateRequest, movieResponse, cancellationToken);
        }