public virtual void Patch(DynamicContentPublishingGroupEntity target)
        {
            if (target == null)
            {
                throw new NullReferenceException(nameof(target));
            }

            target.Description                   = this.Description;
            target.Name                          = this.Name;
            target.Priority                      = this.Priority;
            target.IsActive                      = this.IsActive;
            target.StoreId                       = this.StoreId;
            target.StartDate                     = this.StartDate;
            target.EndDate                       = this.EndDate;
            target.ConditionExpression           = this.ConditionExpression;
            target.PredicateVisualTreeSerialized = this.PredicateVisualTreeSerialized;

            if (!this.ContentItems.IsNullCollection())
            {
                var itemComparer = AnonymousComparer.Create((PublishingGroupContentItemEntity x) => x.DynamicContentItemId);
                this.ContentItems.Patch(target.ContentItems, itemComparer, (sourceProperty, targetProperty) => { });
            }

            if (!this.ContentPlaces.IsNullCollection())
            {
                var itemComparer = AnonymousComparer.Create((PublishingGroupContentPlaceEntity x) => x.DynamicContentPlaceId);
                this.ContentPlaces.Patch(target.ContentPlaces, itemComparer, (sourceProperty, targetProperty) => { });
            }
        }
Ejemplo n.º 2
0
        public virtual void Patch(DynamicContentPublishingGroupEntity target)
        {
            if (target == null)
            {
                throw new ArgumentNullException(nameof(target));
            }

            target.Description = Description;
            target.Name        = Name;
            target.Priority    = Priority;
            target.IsActive    = IsActive;
            target.StoreId     = StoreId;
            target.StartDate   = StartDate;
            target.EndDate     = EndDate;
            target.PredicateVisualTreeSerialized = PredicateVisualTreeSerialized;

            if (!ContentItems.IsNullCollection())
            {
                var itemComparer = AnonymousComparer.Create((PublishingGroupContentItemEntity x) => x.DynamicContentItemId);
                ContentItems.Patch(target.ContentItems, itemComparer, (sourceProperty, targetProperty) => { sourceProperty.Patch(targetProperty); });
            }

            if (!ContentPlaces.IsNullCollection())
            {
                var itemComparer = AnonymousComparer.Create((PublishingGroupContentPlaceEntity x) => x.DynamicContentPlaceId);
                ContentPlaces.Patch(target.ContentPlaces, itemComparer, (sourceProperty, targetProperty) => { sourceProperty.Patch(targetProperty); });
            }
        }