示例#1
0
 public virtual CustomerReview ToLiquidCustomerReview(storefrontModel.CustomerReview item)
 {
     return(new CustomerReview
     {
         AuthorNickname = item.AuthorNickname,
         Content = item.Content,
         CreatedDate = item.CreatedDate,
         IsActive = item.IsActive,
         ProductId = item.ProductId,
         Rate = item.Rate
     });
 }
示例#2
0
        public static CustomerReview ToShopifyModel(this storefrontModel.CustomerReview customerReview)
        {
            var result = new CustomerReview
            {
                ProductId      = customerReview.ProductId,
                AuthorNickname = customerReview.AuthorNickname,
                Content        = customerReview.Content,
                CreatedDate    = customerReview.CreatedDate,
                IsActive       = customerReview.IsActive,
                Rating         = customerReview.Rating,
            };

            return(result);
        }
        public static reviewEntity.CustomerReview ToCustomerReview(this reviewDto.CustomerReview reviewDto)
        {
            var result = new reviewEntity.CustomerReview
            {
                AuthorNickname = reviewDto.AuthorNickname,
                Content        = reviewDto.Content,
                Pros           = reviewDto.Pros,
                Cons           = reviewDto.Cons,
                CreatedBy      = reviewDto.CreatedBy,
                CreatedDate    = reviewDto.CreatedDate,
                IsActive       = reviewDto.IsActive,
                ModifiedBy     = reviewDto.ModifiedBy,
                ModifiedDate   = reviewDto.ModifiedDate,
                ProductId      = reviewDto.ProductId,
                RatingNumber   = reviewDto.RatingNumber,
                Id             = reviewDto.Id
            };

            return(result);
        }
示例#4
0
        public virtual CustomerReview ToLiquidCustomerReview(storefrontModel.CustomerReview item)
        {
            var result = new CustomerReview
            {
                AuthorNickname = item.AuthorNickname,
                Content        = item.Content,
                CreatedDate    = item.CreatedDate,
                IsActive       = item.IsActive,
                ProductId      = item.ProductId,
                Rating         = item.Rating,
                Id             = item.Id
            };

            if (item.ReviewRatings.Count > 0)
            {
                result.ReviewRatings = item.ReviewRatings.Select(x => x.ToShopifyModel()).ToArray();
            }

            return(result);
        }
示例#5
0
 public static CustomerReview ToShopifyModel(this storefrontModel.CustomerReview item)
 {
     return(new ShopifyModelConverter().ToLiquidCustomerReview(item));
 }
        public async Task AddCustomerReviewAsync(CutomerReviewModel review)
        {
            await _customerReviews.UpdateAsync(new CustomerReviewDto[] { CustomerReviewConverter.ToCustomerReviewDto(review) });

            CustomerReviewCacheRegion.ExpireReview(review.ProductId);
        }
 public void AddCustomerReview(CutomerReviewModel review)
 {
     this.AddCustomerReviewAsync(review).GetAwaiter().GetResult();
 }