public async Task AddReviewAsync(string authorNickname, ReviewRequest request) { var newReview = new List <AutoRestClients.CustomerReviewsModule.WebModuleApi.Models.CustomerReview> { new AutoRestClients.CustomerReviewsModule.WebModuleApi.Models.CustomerReview { AuthorNickname = authorNickname, Content = request.Content, CreatedBy = authorNickname, CreatedDate = request.CreatedDate, IsActive = true, ModifiedBy = authorNickname, ModifiedDate = SystemTime.Now, ProductId = request.ProductId, Rating = request.Rating } }; await _customerReviewsApi.UpdateAsync(newReview); CustomerReviewCacheRegion.ExpireRegion(); }
public async Task AddCustomerReviewAsync(CutomerReviewModel review) { await _customerReviews.UpdateAsync(new CustomerReviewDto[] { CustomerReviewConverter.ToCustomerReviewDto(review) }); CustomerReviewCacheRegion.ExpireReview(review.ProductId); }