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); }
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); }
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); } }
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); }
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); }