Class MetadataDocument
Holds ordered application data members in an immutable document.
public sealed class MetadataDocument : IReadOnlyList<KeyValuePair<string, MetadataValue>>, IReadOnlyCollection<KeyValuePair<string, MetadataValue>>, IEnumerable<KeyValuePair<string, MetadataValue>>, IEnumerable, IEquatable<MetadataDocument>
- Inheritance
-
MetadataDocument
- Implements
- Inherited Members
Constructors
MetadataDocument(IEnumerable<KeyValuePair<string, MetadataValue>>)
public MetadataDocument(IEnumerable<KeyValuePair<string, MetadataValue>> members)
Parameters
membersIEnumerable<KeyValuePair<string, MetadataValue>>
Properties
Count
Gets the number of elements in the collection.
public int Count { get; }
Property Value
- int
The number of elements in the collection.
this[int]
Gets the element at the specified index in the read-only list.
public KeyValuePair<string, MetadataValue> this[int index] { get; }
Parameters
indexintThe zero-based index of the element to get.
Property Value
- KeyValuePair<string, MetadataValue>
The element at the specified index in the read-only list.
Methods
Equals(MetadataDocument?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(MetadataDocument? other)
Parameters
otherMetadataDocumentAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<string, MetadataValue>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<string, MetadataValue>>
An enumerator that can be used to iterate through the collection.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
TryGetValue(string, out MetadataValue)
Finds a member by an ordinal key whose comparison is case sensitive without changing document order.
public bool TryGetValue(string key, out MetadataValue value)
Parameters
keystringvalueMetadataValue
Returns
Operators
operator ==(MetadataDocument?, MetadataDocument?)
public static bool operator ==(MetadataDocument? left, MetadataDocument? right)
Parameters
leftMetadataDocumentrightMetadataDocument
Returns
operator !=(MetadataDocument?, MetadataDocument?)
public static bool operator !=(MetadataDocument? left, MetadataDocument? right)
Parameters
leftMetadataDocumentrightMetadataDocument