Table of Contents

Class MetadataDocument

Namespace
Shard.Codecs
Assembly
Shard.Codecs.dll

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

members IEnumerable<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

index int

The 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

other MetadataDocument

An object to compare with this object.

Returns

bool

true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

Determines whether the specified object is equal to the current object.

public override bool Equals(object? obj)

Parameters

obj object

The object to compare with the current object.

Returns

bool

true if the specified object is equal to the current object; otherwise, false.

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

key string
value MetadataValue

Returns

bool

Operators

operator ==(MetadataDocument?, MetadataDocument?)

public static bool operator ==(MetadataDocument? left, MetadataDocument? right)

Parameters

left MetadataDocument
right MetadataDocument

Returns

bool

operator !=(MetadataDocument?, MetadataDocument?)

public static bool operator !=(MetadataDocument? left, MetadataDocument? right)

Parameters

left MetadataDocument
right MetadataDocument

Returns

bool