Example #1
0
        public virtual void Patch(PromotionEntity target)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            target.StartDate   = StartDate;
            target.EndDate     = EndDate;
            target.StoreId     = StoreId;
            target.Name        = Name;
            target.Description = Description;
            target.IsActive    = IsActive;
            target.IsExclusive = IsExclusive;
            target.EndDate     = EndDate;
            target.Priority    = Priority;
            target.PredicateVisualTreeSerialized = PredicateVisualTreeSerialized;
            target.PerCustomerLimit         = PerCustomerLimit;
            target.TotalLimit               = TotalLimit;
            target.PerCustomerLimit         = PerCustomerLimit;
            target.IsAllowCombiningWithSelf = IsAllowCombiningWithSelf;

            if (!Stores.IsNullCollection())
            {
                var comparer = AnonymousComparer.Create((PromotionStoreEntity entity) => entity.StoreId);
                Stores.Patch(target.Stores, comparer, (sourceEntity, targetEntity) => targetEntity.StoreId = sourceEntity.StoreId);
            }
        }
        public virtual void Patch(PromotionEntity target)
        {
            if (target == null)
            {
                throw new NullReferenceException(nameof(target));
            }

            target.StartDate   = this.StartDate;
            target.EndDate     = this.EndDate;
            target.StoreId     = this.StoreId;
            target.Name        = this.Name;
            target.Description = this.Description;
            target.IsActive    = this.IsActive;
            target.IsExclusive = this.IsExclusive;
            target.EndDate     = this.EndDate;
            target.Priority    = this.Priority;
            target.PredicateVisualTreeSerialized = this.PredicateVisualTreeSerialized;
            target.PredicateSerialized           = this.PredicateSerialized;
            target.RewardsSerialized             = this.RewardsSerialized;
            target.PerCustomerLimit         = this.PerCustomerLimit;
            target.TotalLimit               = this.TotalLimit;
            target.PerCustomerLimit         = this.PerCustomerLimit;
            target.IsAllowCombiningWithSelf = this.IsAllowCombiningWithSelf;
        }