GtmPropertiesMergerMerge 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
public static GtmData Merge( GtmData gtmData, Object additionalData, bool overwrite = false )
Exception | Condition |
---|---|
ArgumentNullException | Thrown when gtmData is null. |
InvalidOperationException | Thrown when additionalData can be enumerated as KeyValuePairTKey, TValue items, but a null key is found. |
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 }