Method AddOrReplace
AddOrReplace(MetadataCollection)
Adds or replaces metadata entries from the specified collection.
public void AddOrReplace(MetadataCollection collection)
Parameters
collectionMetadataCollectionThe collection containing metadata entries to add or replace. If
nullor empty, no action is taken.
Remarks
For each metadata entry in collection:
if an entry with the same key exists in this collection, it is replaced;
otherwise, it is added.
Exceptions
- InvalidOperationException
The collection is read-only.
AddOrReplace(Metadata)
Adds a metadata entry to the collection, or replaces an existing entry with the same key.
public void AddOrReplace(Metadata metadata)
Parameters
metadataMetadataThe metadata entry to add or replace.
Remarks
If an entry with the same key already exists in the collection, it is replaced with the new entry. Otherwise, the new entry is added to the collection.
Exceptions
- ArgumentNullException
metadataisnull.- InvalidOperationException
The collection is read-only.