Esempio n. 1
0
        public virtual StorePaymentMethodEntity FromModel(PaymentMethod paymentMethod, PrimaryKeyResolvingMap pkMap)
        {
            if (paymentMethod == null)
            {
                throw new ArgumentNullException(nameof(paymentMethod));
            }

            pkMap.AddPair(paymentMethod, this);

            IsActive              = paymentMethod.IsActive;
            Code                  = paymentMethod.Code;
            Description           = paymentMethod.Description;
            IsAvailableForPartial = paymentMethod.IsAvailableForPartial;
            LogoUrl               = paymentMethod.LogoUrl;
            Name                  = paymentMethod.Name;
            Priority              = paymentMethod.Priority;

            return(this);
        }
Esempio n. 2
0
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        /// <param name="itemAsset">The item asset.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">itemAsset</exception>
        public static dataModel.EditorialReview ToDataModel(this coreModel.EditorialReview review, dataModel.Item product, PrimaryKeyResolvingMap pkMap)
        {
            if (review == null)
            {
                throw new ArgumentNullException("review");
            }

            var retVal = new dataModel.EditorialReview();

            pkMap.AddPair(review, retVal);
            retVal.InjectFrom(review);

            retVal.ItemId      = product.Id;
            retVal.Source      = review.ReviewType;
            retVal.ReviewState = (int)coreModel.ReviewState.Active;
            retVal.Locale      = review.LanguageCode;

            return(retVal);
        }
Esempio n. 3
0
        public virtual PropertyDictionaryItemEntity FromModel(PropertyDictionaryItem propDictItem, PrimaryKeyResolvingMap pkMap)
        {
            if (propDictItem == null)
            {
                throw new ArgumentNullException(nameof(propDictItem));
            }
            pkMap.AddPair(propDictItem, this);

            Id         = propDictItem.Id;
            Alias      = propDictItem.Alias;
            SortOrder  = propDictItem.SortOrder;
            PropertyId = propDictItem.PropertyId;
            if (propDictItem.LocalizedValues != null)
            {
                DictionaryItemValues = new ObservableCollection <PropertyDictionaryValueEntity>(propDictItem.LocalizedValues.Select(x => AbstractTypeFactory <PropertyDictionaryValueEntity> .TryCreateInstance().FromModel(x, pkMap)));
            }

            return(this);
        }
Esempio n. 4
0
        public static ShipmentPackageEntity ToDataModel(this ShipmentPackage package, CustomerOrderEntity orderEntity, PrimaryKeyResolvingMap pkMap)
        {
            if (package == null)
            {
                throw new ArgumentNullException("package");
            }

            var retVal = new ShipmentPackageEntity();

            pkMap.AddPair(package, retVal);
            retVal.InjectFrom(package);

            if (package.Items != null)
            {
                retVal.Items = new ObservableCollection <ShipmentItemEntity>(package.Items.Select(x => x.ToDataModel(orderEntity, pkMap)));
            }

            return(retVal);
        }
        public virtual PropertyEntity FromModel(Property property, PrimaryKeyResolvingMap pkMap)
        {
            if (property == null)
            {
                throw new ArgumentNullException(nameof(property));
            }

            pkMap.AddPair(property, this);

            Id           = property.Id;
            CreatedBy    = property.CreatedBy;
            CreatedDate  = property.CreatedDate;
            ModifiedBy   = property.ModifiedBy;
            ModifiedDate = property.ModifiedDate;

            CatalogId  = property.CatalogId;
            CategoryId = property.CategoryId;

            Name = property.Name;
            PropertyValueType = (int)property.ValueType;
            IsMultiValue      = property.Multivalue;
            IsLocaleDependant = property.Multilanguage;
            IsEnum            = property.Dictionary;
            IsRequired        = property.Required;
            IsHidden          = property.Hidden;
            TargetType        = property.Type.ToString();

            if (property.Attributes != null)
            {
                PropertyAttributes = new ObservableCollection <PropertyAttributeEntity>(property.Attributes.Select(x => AbstractTypeFactory <PropertyAttributeEntity> .TryCreateInstance().FromModel(x, pkMap)));
            }

            if (property.DisplayNames != null)
            {
                DisplayNames = new ObservableCollection <PropertyDisplayNameEntity>(property.DisplayNames.Select(x => AbstractTypeFactory <PropertyDisplayNameEntity> .TryCreateInstance().FromModel(x)));
            }

            if (property.ValidationRules != null)
            {
                ValidationRules = new ObservableCollection <PropertyValidationRuleEntity>(property.ValidationRules.Select(x => AbstractTypeFactory <PropertyValidationRuleEntity> .TryCreateInstance().FromModel(x)));
            }
            return(this);
        }
        public static ShoppingCartEntity ToDataModel(this ShoppingCart cart, PrimaryKeyResolvingMap pkMap)
        {
            if (cart == null)
            {
                throw new ArgumentNullException("cart");
            }

            var retVal = new ShoppingCartEntity();

            pkMap.AddPair(cart, retVal);

            retVal.InjectFrom(cart);

            retVal.Currency = cart.Currency.ToString();

            if (cart.Addresses != null)
            {
                retVal.Addresses = new ObservableCollection <AddressEntity>(cart.Addresses.Select(x => x.ToDataModel()));
            }
            if (cart.Items != null)
            {
                retVal.Items = new ObservableCollection <LineItemEntity>(cart.Items.Select(x => x.ToDataModel(pkMap)));
            }
            if (cart.Shipments != null)
            {
                retVal.Shipments = new ObservableCollection <ShipmentEntity>(cart.Shipments.Select(x => x.ToDataModel(pkMap)));
            }
            if (cart.Payments != null)
            {
                retVal.Payments = new ObservableCollection <PaymentEntity>(cart.Payments.Select(x => x.ToDataModel(pkMap)));
            }
            if (cart.TaxDetails != null)
            {
                retVal.TaxDetails = new ObservableCollection <TaxDetailEntity>();
                retVal.TaxDetails.AddRange(cart.TaxDetails.Select(x => x.ToDataModel()));
            }
            if (cart.Discounts != null)
            {
                retVal.Discounts = new ObservableCollection <DiscountEntity>();
                retVal.Discounts.AddRange(cart.Discounts.Select(x => x.ToDataModel(pkMap)));
            }
            return(retVal);
        }
        public static dataModel.QuoteItemEntity ToDataModel(this coreModel.QuoteItem quoteItem, PrimaryKeyResolvingMap pkMap)
        {
            if (quoteItem == null)
            {
                throw new ArgumentNullException("quoteItem");
            }

            var retVal = new dataModel.QuoteItemEntity();

            pkMap.AddPair(quoteItem, retVal);
            retVal.InjectFrom(quoteItem);
            retVal.Currency = quoteItem.Currency.ToString();
            if (quoteItem.ProposalPrices != null)
            {
                retVal.ProposalPrices = new ObservableCollection <dataModel.TierPriceEntity>(quoteItem.ProposalPrices.Select(x => x.ToDataModel()));
            }

            return(retVal);
        }
Esempio n. 8
0
        public virtual DynamicPropertyEntity FromModel(DynamicProperty dynamicProp, PrimaryKeyResolvingMap pkMap)
        {
            if (dynamicProp == null)
            {
                throw new ArgumentNullException(nameof(dynamicProp));
            }

            pkMap.AddPair(dynamicProp, this);

            Id             = dynamicProp.Id;
            CreatedBy      = dynamicProp.CreatedBy;
            CreatedDate    = dynamicProp.CreatedDate;
            ModifiedBy     = dynamicProp.ModifiedBy;
            ModifiedDate   = dynamicProp.ModifiedDate;
            Description    = dynamicProp.Description;
            DisplayOrder   = dynamicProp.DisplayOrder;
            IsArray        = dynamicProp.IsArray;
            IsDictionary   = dynamicProp.IsDictionary;
            IsMultilingual = dynamicProp.IsMultilingual;
            IsRequired     = dynamicProp.IsRequired;
            Name           = dynamicProp.Name;
            ObjectType     = dynamicProp.ObjectType;

            ValueType = dynamicProp.ValueType.ToString();
            if (dynamicProp.DisplayNames != null)
            {
                DisplayNames = new ObservableCollection <DynamicPropertyNameEntity>(dynamicProp.DisplayNames.Select(x => AbstractTypeFactory <DynamicPropertyNameEntity> .TryCreateInstance().FromModel(x)));
            }

            if (dynamicProp is DynamicObjectProperty dynamicObjectProp && dynamicObjectProp.Values != null)
            {
                //Force set these properties from owned property object
                foreach (var value in dynamicObjectProp.Values)
                {
                    value.ObjectId   = dynamicObjectProp.ObjectId;
                    value.ObjectType = dynamicObjectProp.ObjectType;
                    value.ValueType  = dynamicObjectProp.ValueType;
                }
                //ObjectValues = new ObservableCollection<DynamicPropertyObjectValueEntity>(dynamicObjectProp.Values.Select(x => AbstractTypeFactory<DynamicPropertyObjectValueEntity>.TryCreateInstance().FromModel(x)));
            }
            return(this);
        }
Esempio n. 9
0
        public static CustomerOrderEntity ToDataModel(this CustomerOrder order, PrimaryKeyResolvingMap pkMap)
        {
            if (order == null)
            {
                throw new ArgumentNullException("order");
            }

            var retVal = new CustomerOrderEntity();

            pkMap.AddPair(order, retVal);
            retVal.InjectFrom(order);

            retVal.Currency = order.Currency.ToString();


            if (order.Addresses != null)
            {
                retVal.Addresses = new ObservableCollection <AddressEntity>(order.Addresses.Select(x => x.ToDataModel()));
            }
            if (order.Items != null)
            {
                retVal.Items = new ObservableCollection <LineItemEntity>(order.Items.Select(x => x.ToDataModel(pkMap)));
            }
            if (order.Shipments != null)
            {
                retVal.Shipments = new ObservableCollection <ShipmentEntity>(order.Shipments.Select(x => x.ToDataModel(retVal, pkMap)));
            }
            if (order.InPayments != null)
            {
                retVal.InPayments = new ObservableCollection <PaymentInEntity>(order.InPayments.Select(x => x.ToDataModel(retVal, pkMap)));
            }
            if (order.Discount != null)
            {
                retVal.Discounts = new ObservableCollection <DiscountEntity>(new DiscountEntity[] { order.Discount.ToDataModel() });
            }
            if (order.TaxDetails != null)
            {
                retVal.TaxDetails = new ObservableCollection <TaxDetailEntity>();
                retVal.TaxDetails.AddRange(order.TaxDetails.Select(x => x.ToDataModel()));
            }
            return(retVal);
        }
Esempio n. 10
0
        public virtual PricelistEntity FromModel(Pricelist pricelist, PrimaryKeyResolvingMap pkMap)
        {
            if (pricelist == null)
            {
                throw new ArgumentNullException("pricelist");
            }

            pkMap.AddPair(pricelist, this);

            this.Id           = pricelist.Id;
            this.CreatedBy    = pricelist.CreatedBy;
            this.CreatedDate  = pricelist.CreatedDate;
            this.Currency     = pricelist.Currency;
            this.Description  = pricelist.Description;
            this.ModifiedBy   = pricelist.ModifiedBy;
            this.ModifiedDate = pricelist.ModifiedDate;
            this.Name         = pricelist.Name;

            return(this);
        }
Esempio n. 11
0
        /// <summary>
        /// This method used to convert domain Member type instance to data model
        /// </summary>
        public override MemberDataEntity FromModel(Member member, PrimaryKeyResolvingMap pkMap)
        {
            var retVal   = base.FromModel(member, pkMap) as SupplierDataEntity;
            var supplier = member as Supplier;

            if (supplier != null && !supplier.Reviews.IsNullOrEmpty())
            {
                retVal.Reviews = new ObservableCollection <SupplierReviewDataEntity>();
                foreach (var review in supplier.Reviews)
                {
                    var reviewDataEntity = new SupplierReviewDataEntity();
                    pkMap.AddPair(review, reviewDataEntity);
                    retVal.Reviews.Add(reviewDataEntity.FromModel(review));
                }
            }

            // Here you can write code for custom mapping
            // supplier properties will be mapped in base method implementation by using value injection
            return(retVal);
        }
Esempio n. 12
0
        public virtual SitemapEntity FromModel(Sitemap sitemap, PrimaryKeyResolvingMap pkMap)
        {
            if (sitemap == null)
            {
                throw new ArgumentNullException(nameof(sitemap));
            }
            if (pkMap == null)
            {
                throw new ArgumentNullException(nameof(pkMap));
            }

            pkMap.AddPair(sitemap, this);

            Id          = sitemap.Id;
            Filename    = sitemap.Location;
            StoreId     = sitemap.StoreId;
            UrlTemplate = sitemap.UrlTemplate;

            return(this);
        }
Esempio n. 13
0
        public virtual ShipmentItemEntity FromModel(ShipmentItem shipmentItem, PrimaryKeyResolvingMap pkMap)
        {
            if (shipmentItem == null)
            {
                throw new ArgumentNullException(nameof(shipmentItem));
            }

            Id           = shipmentItem.Id;
            CreatedDate  = shipmentItem.CreatedDate;
            CreatedBy    = shipmentItem.CreatedBy;
            ModifiedDate = shipmentItem.ModifiedDate;
            ModifiedBy   = shipmentItem.ModifiedBy;

            BarCode = shipmentItem.BarCode;
            shipmentItem.Quantity = shipmentItem.Quantity;

            pkMap.AddPair(shipmentItem, this);
            ModelLineItem = shipmentItem.LineItem;
            return(this);
        }
        public virtual DynamicContentFolderEntity FromModel(DynamicContentFolder folder, PrimaryKeyResolvingMap pkMap)
        {
            if (folder == null)
            {
                throw new NullReferenceException(nameof(folder));
            }

            pkMap.AddPair(folder, this);

            Id             = folder.Id;
            CreatedBy      = folder.CreatedBy;
            CreatedDate    = folder.CreatedDate;
            Description    = folder.Description;
            ModifiedBy     = folder.ModifiedBy;
            ModifiedDate   = folder.ModifiedDate;
            Name           = folder.Name;
            ParentFolderId = folder.ParentFolderId;

            return(this);
        }
        public virtual ProductRatingEntity FromModel(ProductRating productRating, PrimaryKeyResolvingMap pkMap)
        {
            if (productRating == null)
            {
                throw new ArgumentNullException(nameof(productRating));
            }

            pkMap.AddPair(productRating, this);

            Id           = productRating.Id;
            CreatedBy    = productRating.CreatedBy;
            CreatedDate  = productRating.CreatedDate;
            ModifiedBy   = productRating.ModifiedBy;
            ModifiedDate = productRating.ModifiedDate;

            ProductId = productRating.ProductId;
            Rating    = productRating.Rating;

            return(this);
        }
        public static PaymentEntity ToDataModel(this Payment payment, PrimaryKeyResolvingMap pkMap)
        {
            if (payment == null)
            {
                throw new ArgumentNullException("payment");
            }

            var retVal = new PaymentEntity();

            pkMap.AddPair(payment, retVal);
            retVal.InjectFrom(payment);

            retVal.Currency = payment.Currency.ToString();

            if (payment.BillingAddress != null)
            {
                retVal.Addresses = new ObservableCollection <AddressEntity>(new AddressEntity[] { payment.BillingAddress.ToDataModel() });
            }
            return(retVal);
        }
        /// <summary>
        /// Converting to foundation type
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="propValue">The property value.</param>
        /// <returns></returns>
        /// <exception cref="System.ArgumentNullException">propValue</exception>
        public static dataModel.PropertyValue ToDataModel(this coreModel.PropertyValue propValue, PrimaryKeyResolvingMap pkMap)
        {
            if (propValue == null)
            {
                throw new ArgumentNullException("propValue");
            }

            var retVal = new dataModel.PropertyValue();

            pkMap.AddPair(propValue, retVal);
            retVal.InjectFrom(propValue);

            retVal.Name      = propValue.PropertyName;
            retVal.KeyValue  = propValue.ValueId;
            retVal.Locale    = propValue.LanguageCode;
            retVal.ValueType = (int)propValue.ValueType;
            SetPropertyValue(retVal, propValue.ValueType, propValue.Value.ToString());

            return(retVal);
        }
        public virtual PaymentPlanEntity FromModel(PaymentPlan paymentPlan, PrimaryKeyResolvingMap pkMap)
        {
            if (paymentPlan == null)
            {
                throw new ArgumentNullException(nameof(paymentPlan));
            }

            pkMap.AddPair(paymentPlan, this);

            Id              = paymentPlan.Id;
            CreatedBy       = paymentPlan.CreatedBy;
            CreatedDate     = paymentPlan.CreatedDate;
            ModifiedBy      = paymentPlan.ModifiedBy;
            ModifiedDate    = paymentPlan.ModifiedDate;
            IntervalCount   = paymentPlan.IntervalCount;
            TrialPeriodDays = paymentPlan.TrialPeriodDays;
            Interval        = paymentPlan.Interval.ToString();

            return(this);
        }
        public virtual EditorialReviewEntity FromModel(EditorialReview review, PrimaryKeyResolvingMap pkMap)
        {
            if (review == null)
            {
                throw new ArgumentNullException(nameof(review));
            }

            pkMap.AddPair(review, this);

            this.Id           = review.Id;
            this.Content      = review.Content;
            this.CreatedBy    = review.CreatedBy;
            this.CreatedDate  = review.CreatedDate;
            this.ModifiedBy   = review.ModifiedBy;
            this.ModifiedDate = review.ModifiedDate;
            this.Locale       = review.LanguageCode;
            this.Source       = review.ReviewType;

            return(this);
        }
        public virtual PropertyAttributeEntity FromModel(PropertyAttribute attribute, PrimaryKeyResolvingMap pkMap)
        {
            if (attribute == null)
            {
                throw new ArgumentNullException(nameof(attribute));
            }

            pkMap.AddPair(attribute, this);

            this.Id                     = attribute.Id;
            this.CreatedBy              = attribute.CreatedBy;
            this.CreatedDate            = attribute.CreatedDate;
            this.ModifiedBy             = attribute.ModifiedBy;
            this.ModifiedDate           = attribute.ModifiedDate;
            this.PropertyId             = attribute.PropertyId;
            this.PropertyAttributeName  = attribute.Name;
            this.PropertyAttributeValue = attribute.Value;

            return(this);
        }
Esempio n. 21
0
        public virtual PriceEntity FromModel(Price price, PrimaryKeyResolvingMap pkMap)
        {
            if (price == null)
            {
                throw new ArgumentNullException(nameof(price));
            }

            pkMap.AddPair(price, this);

            this.Id           = price.Id;
            this.List         = price.List;
            this.MinQuantity  = price.MinQuantity;
            this.ModifiedBy   = price.ModifiedBy;
            this.ModifiedDate = price.ModifiedDate;
            this.PricelistId  = price.PricelistId;
            this.ProductId    = price.ProductId;
            this.Sale         = price.Sale;

            return(this);
        }
        public virtual StoreShippingMethodEntity FromModel(ShippingMethod model, PrimaryKeyResolvingMap pkMap)
        {
            if (model == null)
            {
                throw new ArgumentNullException(nameof(model));
            }

            pkMap.AddPair(model, this);

            Id       = model.Id;
            IsActive = model.IsActive;
            Code     = model.Code;
            TaxType  = model.TaxType;
            LogoUrl  = model.LogoUrl;
            Priority = model.Priority;
            StoreId  = model.StoreId;
            TypeName = model.TypeName;

            return(this);
        }
Esempio n. 23
0
        public virtual PromotionUsageEntity FromModel(PromotionUsage usage, PrimaryKeyResolvingMap pkMap)
        {
            if (usage == null)
            {
                throw new NullReferenceException(nameof(usage));
            }

            pkMap.AddPair(usage, this);

            this.Id           = usage.Id;
            this.CreatedBy    = usage.CreatedBy;
            this.CreatedDate  = usage.CreatedDate;
            this.ModifiedBy   = usage.ModifiedBy;
            this.ModifiedDate = usage.ModifiedDate;
            this.CouponCode   = usage.CouponCode;
            this.PromotionId  = usage.PromotionId;
            this.ObjectId     = usage.ObjectId;
            this.ObjectType   = usage.ObjectType;

            return(this);
        }
        public override MemberDataEntity FromMember(Member member, PrimaryKeyResolvingMap pkMap)
        {
            var organization = member as Organization;

            pkMap.AddPair(organization, this);

            if (organization.ParentId != null)
            {
                this.MemberRelations = new ObservableCollection <MemberRelationDataEntity>();
                var memberRelation = new MemberRelationDataEntity
                {
                    AncestorId       = organization.ParentId,
                    DescendantId     = organization.Id,
                    AncestorSequence = 1
                };
                this.MemberRelations.Add(memberRelation);
            }

            //Call base converter
            return(base.FromMember(member, pkMap));
        }
        public virtual OperationLogEntity FromModel(OperationLog operation, PrimaryKeyResolvingMap pkMap)
        {
            if (operation == null)
            {
                throw new ArgumentNullException(nameof(operation));
            }

            pkMap.AddPair(operation, this);

            CreatedBy     = operation.CreatedBy;
            CreatedDate   = operation.CreatedDate;
            Detail        = operation.Detail;
            Id            = operation.Id;
            ModifiedBy    = operation.ModifiedBy;
            ModifiedDate  = operation.ModifiedDate;
            ObjectId      = operation.ObjectId;
            ObjectType    = operation.ObjectType;
            OperationType = operation.OperationType.ToString();

            return(this);
        }
        public virtual DynamicContentPlaceEntity FromModel(DynamicContentPlace place, PrimaryKeyResolvingMap pkMap)
        {
            if (place == null)
            {
                throw new NullReferenceException(nameof(place));
            }

            pkMap.AddPair(place, this);

            this.Id           = place.Id;
            this.CreatedBy    = place.CreatedBy;
            this.CreatedDate  = place.CreatedDate;
            this.Description  = place.Description;
            this.ModifiedBy   = place.ModifiedBy;
            this.ModifiedDate = place.ModifiedDate;
            this.Name         = place.Name;
            this.FolderId     = place.FolderId;
            this.ImageUrl     = place.ImageUrl;

            return(this);
        }
Esempio n. 27
0
        public virtual UsageEventEntity FromModel(UsageEvent usageEvent, PrimaryKeyResolvingMap pkMap)
        {
            if (usageEvent == null)
            {
                throw new ArgumentNullException("usageEvent");
            }

            pkMap.AddPair(usageEvent, this);

            Id           = usageEvent.Id;
            CreatedBy    = usageEvent.CreatedBy;
            CreatedDate  = usageEvent.CreatedDate;
            ModifiedBy   = usageEvent.ModifiedBy;
            ModifiedDate = usageEvent.ModifiedDate;
            CustomerId   = usageEvent.CustomerId;
            StoreId      = usageEvent.StoreId;
            ItemId       = usageEvent.ItemId;
            EventType    = usageEvent.EventType.ToString();

            return(this);
        }
        public virtual ShipmentPackageEntity FromModel(ShipmentPackage package, PrimaryKeyResolvingMap pkMap)
        {
            if (package == null)
            {
                throw new ArgumentNullException(nameof(package));
            }

            pkMap.AddPair(package, this);
            this.InjectFrom(package);

            if (!Items.IsNullOrEmpty())
            {
                Items = new ObservableCollection <ShipmentItemEntity>(package.Items.Select(x => AbstractTypeFactory <ShipmentItemEntity> .TryCreateInstance().FromModel(x, pkMap)));
                foreach (var shipmentItem in Items)
                {
                    shipmentItem.ShipmentPackageId = Id;
                }
            }

            return(this);
        }
Esempio n. 29
0
        public virtual SeoInfoEntity FromModel(SeoInfo seoInfo, PrimaryKeyResolvingMap pkMap)
        {
            pkMap.AddPair(seoInfo, this);

            Id           = seoInfo.Id;
            CreatedBy    = seoInfo.CreatedBy;
            CreatedDate  = seoInfo.CreatedDate;
            ModifiedBy   = seoInfo.ModifiedBy;
            ModifiedDate = seoInfo.ModifiedDate;

            Language            = seoInfo.LanguageCode;
            Keyword             = seoInfo.SemanticUrl;
            Title               = seoInfo.PageTitle;
            ImageAltDescription = seoInfo.ImageAltDescription;
            IsActive            = seoInfo.IsActive;
            MetaDescription     = seoInfo.MetaDescription;
            MetaKeywords        = seoInfo.MetaKeywords;
            StoreId             = seoInfo.StoreId;

            return(this);
        }
        public virtual CustomerReviewVoteEntity FromModel(CustomerReviewVote customerReviewVote, PrimaryKeyResolvingMap pkMap)
        {
            if (customerReviewVote == null)
            {
                throw new ArgumentNullException(nameof(customerReviewVote));
            }

            pkMap.AddPair(customerReviewVote, this);

            Id           = customerReviewVote.Id;
            CreatedBy    = customerReviewVote.CreatedBy;
            CreatedDate  = customerReviewVote.CreatedDate;
            ModifiedBy   = customerReviewVote.ModifiedBy;
            ModifiedDate = customerReviewVote.ModifiedDate;

            AuthorId         = customerReviewVote.AuthorId;
            ReviewRate       = customerReviewVote.ReviewRate;
            CustomerReviewId = customerReviewVote.CustomerReviewId;

            return(this);
        }