Constructor Metadata
Metadata(string, string)
Initializes a new instance of the Metadata class with the specified key and value.
public Metadata(string key, string value)
Parameters
key
stringThe key that identifies this metadata entry. It must not be null or empty.
value
stringThe value associated with the key. It must not be null. An empty string is allowed.
Examples
// Create a new metadata entry.
var metadata = new Metadata("Author", "John Doe");
// Output the key and value.
Console.WriteLine(metadata.Key); // Output: Author
Console.WriteLine(metadata.Value); // Output: John Doe
Exceptions
- ArgumentNullException
Thrown if
value
is null.- ArgumentException
Thrown if
key
is null or empty.