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); }
public async Task <MovieResponse> GetMovie(int userId, string movieName) { var response = await _movieRankRepository.GetMovie(userId, movieName); return(_map.ToMovieContract(response)); }
public async Task <MovieResponse> GetMovie(int userId, string movieName) { MovieResponse result = await _repository.GetMovie(userId, movieName); return(_mapper.ToMovieContract(result)); }
public async Task <MovieResponse> GetMovieFromDatabase(int userId, string movieName) { MovieDb response = await _movieRankRepository.GetMovie(userId, movieName); return(_mapper.ToMovieContract(response)); }
public async Task DeleteMovieRanking(int userId, string movieName) { var movie = await _movieRankRepository.GetMovie(userId, movieName); await _movieRankRepository.DeleteMovieRanking(movie); }