Method Add
Add(Metadata)
Adds a metadata entry to the collection.
public void Add(Metadata metadata)
Parameters
metadataMetadataThe metadata entry to add.
Exceptions
- ArgumentNullException
metadataisnull.- ArgumentException
A metadata entry with the same key already exists in the collection.
- InvalidOperationException
The collection is read-only.
Add(KeyValuePair<string, string>)
Adds a metadata entry to the collection using a key-value pair.
public void Add(KeyValuePair<string, string> item)
Parameters
itemKeyValuePair<string, string>A KeyValuePair<TKey, TValue> representing the key and value to add.
Exceptions
- ArgumentException
A metadata entry with the same key already exists in the collection.
- InvalidOperationException
The collection is read-only.
Add(MetadataCollection)
Adds all metadata entries from another MetadataCollection to this collection.
public void Add(MetadataCollection collection)
Parameters
collectionMetadataCollectionThe collection containing metadata entries to add. If
nullor empty, no action is taken.
Exceptions
- ArgumentException
A metadata entry in
collectionhas a key that already exists in this collection.- InvalidOperationException
The collection is read-only.
Add(string, string)
Adds a metadata entry to the collection by specifying a key and a value.
public void Add(string key, string value)
Parameters
keystringThe key of the metadata entry to add.
valuestringThe value of the metadata entry to add.
Exceptions
- ArgumentException
A metadata entry with the same
keyalready exists in the collection.- InvalidOperationException
The collection is read-only.