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
keystringThe key that identifies this metadata entry. It must not be null or empty.
valuestringThe 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
valueis null.- ArgumentException
Thrown if
keyis null or empty.