public RatingResult ComputeResult(IRatingAlgorithm algorithm, 
                                          int numberOfReviewsToUse)
        {
            var filteredReviews = _restaurant.Reviews.Take(numberOfReviewsToUse);

            return algorithm.Compute(filteredReviews.ToList());
        }       
Exemplo n.º 2
0
        public RatingResult ComputeResult(IRatingAlgorithm algorithm,
                                          int numberOfReviewsToUse)
        {
            var filteredReviews = _restaurant.Reviews.Take(numberOfReviewsToUse);

            return(algorithm.Compute(filteredReviews.ToList()));
        }
        public RatingResult ComputeRating(IRatingAlgorithm ratingAlgorithm, int numberOfReviews)
        {
            var reviews = _restaurant
                          .Reviews
                          .Take(numberOfReviews)
                          .ToList();

            return(ratingAlgorithm.Compute(reviews));
        }
Exemplo n.º 4
0
 public RateResult ComputeRate( IRatingAlgorithm algorithm, int numerToUse)
 {
     return
         algorithm.Compute(_ratable.Reviews.Take(numerToUse).ToList());
 }
Exemplo n.º 5
0
        public int ComputeRating(IRatingAlgorithm ratingAlgorithm, int numberOfReviewsTouse)
        {
            var restaurantToRate = restaurant.Reviews.Take(numberOfReviewsTouse).ToList();

            return(ratingAlgorithm.Compute(restaurantToRate));
        }
 public RatingResult ComputeResult(IRatingAlgorithm algorithm, int numberOfReviews)
 {
     return(algorithm.Compute(_Restaurant.Reviews.Take(numberOfReviews).ToList()));
 }