Esempio n. 1
0
        public async Task <MovieRankResponse> GetMovieRank(string movieName)
        {
            var response = await _movieRankRepository.GetMovieRank(movieName);

            var overallMovieRanking = Math.Round(response.Select(x => x.Ranking).Average());

            return(new MovieRankResponse()
            {
                MovieName = movieName,
                OverallRanking = overallMovieRanking
            });
        }
Esempio n. 2
0
        public async Task <MovieRankResponse> GetMovieRank(string movieName)
        {
            var response = await movieRankRepository.GetMovieRank(movieName);

            var overallMovieRaking = Math.Round(response.Items.Select(item => Convert.ToInt32(item["Ranking"].N)).Average());

            return(new MovieRankResponse
            {
                MovieName = movieName,
                OverallRanking = overallMovieRaking
            });
        }