Exemplo n.º 1
0
        public static Model.ReviewRatings.ReviewRating ToReviewRating(this ReviewDto.CustomerReviewRating itemDto)
        {
            var result = new Model.ReviewRatings.ReviewRating
            {
                AuthorNickname = itemDto.AuthorNickname,
                CreatedBy      = itemDto.AuthorNickname,
                CreatedDate    = itemDto.CreatedDate,
                Id             = itemDto.Id,
                ModifiedBy     = itemDto.ModifiedBy,
                ModifiedDate   = itemDto.ModifiedDate,
                Rating         = itemDto.Rating,
                ReviewId       = itemDto.ReviewId,
            };

            return(result);
        }
Exemplo n.º 2
0
        public static ReviewDto.CustomerReviewRating FromDto(this Model.ReviewRatings.ReviewRating rating)
        {
            var result = new ReviewDto.CustomerReviewRating
            {
                AuthorNickname = rating.AuthorNickname,
                CreatedBy      = rating.CreatedBy,
                CreatedDate    = rating.CreatedDate,
                Id             = rating.Id,
                ModifiedBy     = rating.ModifiedBy,
                ModifiedDate   = rating.ModifiedDate,
                Rating         = rating.Rating,
                ReviewId       = rating.ReviewId
            };

            return(result);
        }
        public async Task RateReviewAsync(Model.ReviewRatings.ReviewRating rating)
        {
            await _customerReviewsApi.RateAsync(rating.FromDto());

            ReviewRatingCacheRegion.ExpireRegion();
        }
 public void RateReview(Model.ReviewRatings.ReviewRating rating)
 {
     RateReviewAsync(rating).GetAwaiter().GetResult();
 }