public static UserReviewDto ToCurrentUserReviewDto(this UserReview user, string review)
        {
            var result = new UserReviewDto();

            result.Content = review;
            return(result);
        }
        public static TextAnalyticsDto ToTextAnalyticsDocuments(this UserReviewDto review)
        {
            var result = new TextAnalyticsDto();

            result.Documents = new List <TextAnalyticsDocumentsDto>();
            result.Documents.Add(review.ToTextAnalyticsDocumentsDto());
            return(result);
        }
        public static TextAnalyticsDocumentsDto ToTextAnalyticsDocumentsDto(this UserReviewDto review)
        {
            var document = new TextAnalyticsDocumentsDto();

            document.Id   = review.ApplicationUserId.ToString();
            document.Text = review.Content;
            return(document);
        }
        public static UserReviewDto ToUserReviewDto(this UserReview review)
        {
            var result = new UserReviewDto();

            result.Content = review.Content;
            result.ApplicationUserDto.UserDetailsDto = review.ApplicationUser.UserDetails.ToUserDetailsDto();
            return(result);
        }
        public static UserReview FromUserReviewDto(this UserReview entityUserReview, UserReviewDto userReviewDto)
        {
            entityUserReview.ApplicationUserId = userReviewDto.ApplicationUserId;
            entityUserReview.Content           = userReviewDto.Content;
            entityUserReview.ProductName       = userReviewDto.ProductName;
            entityUserReview.Sentiment         = userReviewDto.TextAnalyticRespons.Documents.Select(x => x.Score)
                                                 .FirstOrDefault();


            return(entityUserReview);
        }