public virtual void Patch(PropertyEntity target) { target.PropertyValueType = PropertyValueType; target.IsEnum = IsEnum; target.IsMultiValue = IsMultiValue; target.IsLocaleDependant = IsLocaleDependant; target.IsRequired = IsRequired; target.TargetType = TargetType; target.Name = Name; target.CatalogId = CatalogId; target.CategoryId = CategoryId; if (!PropertyAttributes.IsNullCollection()) { var attributeComparer = AnonymousComparer.Create((PropertyAttributeEntity x) => x.IsTransient() ? x.PropertyAttributeName : x.Id); PropertyAttributes.Patch(target.PropertyAttributes, attributeComparer, (sourceAsset, targetAsset) => sourceAsset.Patch(targetAsset)); } if (!DictionaryItems.IsNullCollection()) { var dictItemComparer = AnonymousComparer.Create((PropertyDictionaryItemEntity x) => $"{x.Alias}-${x.PropertyId}"); DictionaryItems.Patch(target.DictionaryItems, dictItemComparer, (sourceDictItem, targetDictItem) => sourceDictItem.Patch(targetDictItem)); } if (!DisplayNames.IsNullCollection()) { var displayNamesComparer = AnonymousComparer.Create((PropertyDisplayNameEntity x) => $"{x.Name}-{x.Locale}"); DisplayNames.Patch(target.DisplayNames, displayNamesComparer, (sourceDisplayName, targetDisplayName) => sourceDisplayName.Patch(targetDisplayName)); } if (!ValidationRules.IsNullCollection()) { ValidationRules.Patch(target.ValidationRules, (sourceRule, targetRule) => sourceRule.Patch(targetRule)); } }
public virtual void Patch(PropertyEntity target) { target.PropertyValueType = this.PropertyValueType; target.IsEnum = this.IsEnum; target.IsMultiValue = this.IsMultiValue; target.IsLocaleDependant = this.IsLocaleDependant; target.IsRequired = this.IsRequired; target.TargetType = this.TargetType; target.Name = this.Name; if (!this.PropertyAttributes.IsNullCollection()) { var attributeComparer = AnonymousComparer.Create((PropertyAttributeEntity x) => x.IsTransient() ? x.PropertyAttributeName : x.Id); this.PropertyAttributes.Patch(target.PropertyAttributes, attributeComparer, (sourceAsset, targetAsset) => sourceAsset.Patch(targetAsset)); } if (!this.DictionaryValues.IsNullCollection()) { this.DictionaryValues.Patch(target.DictionaryValues, (sourcePropValue, targetPropValue) => sourcePropValue.Patch(targetPropValue)); } if (!this.DisplayNames.IsNullCollection()) { var displayNamesComparer = AnonymousComparer.Create((PropertyDisplayNameEntity x) => $"{x.Name}-{x.Locale}"); this.DisplayNames.Patch(target.DisplayNames, displayNamesComparer, (sourceDisplayName, targetDisplayName) => sourceDisplayName.Patch(targetDisplayName)); } if (!this.ValidationRules.IsNullCollection()) { this.ValidationRules.Patch(target.ValidationRules, (sourceRule, targetRule) => sourceRule.Patch(targetRule)); } }