Click or drag to resize
GtmPropertiesMergerMergeInternal Method

Merges gtmData and additionalData to form new GtmData.

If additionalData can be enumerated as KeyValuePairTKey, TValue items, then the key-value pairs are merged. Otherwise, the public properties and their values are merged.

Namespace: CMS.Ecommerce
Assembly: CMS.Ecommerce (in CMS.Ecommerce.dll) Version: 11.0.0
Syntax
C#
protected virtual GtmData MergeInternal(
	GtmData gtmData,
	Object additionalData,
	bool overwrite = false
)

Parameters

gtmData
Type: CMS.EcommerceGtmData
Source object to be merged with additionalData object.
additionalData
Type: SystemObject
Properties of this object are merged with gtmData object.
overwrite (Optional)
Type: SystemBoolean
Decides whether values of properties with the same name are substituted for values of additionalData object.

Return Value

Type: GtmData
New GtmData with combined properties and values of original gtmData and additionalData.
Exceptions
Remarks
Objects properties are merged only on the first level.
Examples

Source object: new GtmData { a = 1, b = 2 }

Merge object: new { a = 3, c = 4 }

Rewrite equals false: new GtmData { a = 1, b = 2, c = 4 }

Rewrite equals false: new GtmData { a = 3, b = 2, c = 4 }

See Also