Class MetadataDictionary
- Namespace
- Savvyio
- Assembly
- Savvyio.Core.dll
Provides a default implementation of the IMetadataDictionary interface. This class cannot be inherited.
public sealed class MetadataDictionary : IMetadataDictionary, IDictionary<string, object>, ICollection<KeyValuePair<string, object>>, IEnumerable<KeyValuePair<string, object>>, IEnumerable
- Inheritance
-
objectMetadataDictionary
- Implements
Constructors
MetadataDictionary()
Initializes a new instance of the MetadataDictionary class.
public MetadataDictionary()
Fields
AggregateVersion
AggregateVersion is a reserved keyword.
public const string AggregateVersion = "AggregateVersion"
Field Value
CausationId
CausationId is a reserved keyword.
public const string CausationId = "CausationId"
Field Value
CorrelationId
CorrelationId is a reserved keyword.
public const string CorrelationId = "CorrelationId"
Field Value
EventId
EventId is a reserved keyword.
public const string EventId = "EventId"
Field Value
MemberType
MemberType is a reserved keyword.
public const string MemberType = "MemberType"
Field Value
RequestId
RequestId is a reserved keyword.
public const string RequestId = "RequestId"
Field Value
Timestamp
Timestamp is a reserved keyword.
public const string Timestamp = "Timestamp"
Field Value
Properties
Count
Gets the number of elements contained in the MetadataDictionary.
public int Count { get; }
Property Value
- int
The number of key/value pairs contained in the MetadataDictionary.
IsReadOnly
Gets a value indicating whether the MetadataDictionaryis read-only.
public bool IsReadOnly { get; }
Property Value
- bool
trueif this instance is read only; otherwise,false.
this[string]
Gets or sets the element with the specified key.
public object this[string key] { get; set; }
Parameters
keystringThe key of the value to get or set.
Property Value
- object
The value associated with the specified key.
Keys
Gets an ICollection<T> containing the keys of the MetadataDictionary.
public ICollection<string> Keys { get; }
Property Value
- ICollection<string>
A Dictionary<TKey, TValue>.KeyCollection containing the keys in the MetadataDictionary.
ReservedKeywords
Gets a list of the reserved keywords.
public static IReadOnlyCollection<string> ReservedKeywords { get; }
Property Value
- IReadOnlyCollection<string>
A list of the reserved keywords.
Values
Gets an ICollection<T> containing the values in the MetadataDictionary.
public ICollection<object> Values { get; }
Property Value
- ICollection<object>
A Dictionary<TKey, TValue>.ValueCollection containing the values in the MetadataDictionary.
Methods
Add(KeyValuePair<string, object>)
Adds an item to the MetadataDictionary.
public void Add(KeyValuePair<string, object> item)
Parameters
itemKeyValuePair<string, object>The object to add to the MetadataDictionary.
Add(string, object)
Adds an element with the provided key and value to the MetadataDictionary.
public void Add(string key, object value)
Parameters
keystringThe object to use as the key of the element to add.
valueobjectThe object to use as the value of the element to add.
Clear()
Removes all items from the MetadataDictionary.
public void Clear()
Contains(KeyValuePair<string, object>)
Determines whether the MetadataDictionary contains a specific value.
public bool Contains(KeyValuePair<string, object> item)
Parameters
itemKeyValuePair<string, object>The object to locate in the MetadataDictionary.
Returns
- bool
true if
itemis found in the MetadataDictionary; otherwise, false.
ContainsKey(string)
Determines whether the MetadataDictionary contains an element with the specified key.
public bool ContainsKey(string key)
Parameters
keystringThe key to locate in the MetadataDictionary.
Returns
- bool
true if the MetadataDictionary contains an element with the key; otherwise, false.
CopyTo(KeyValuePair<string, object>[], int)
Copies the elements of the MetadataDictionary to an array of type KeyValuePair<TKey, TValue>, starting at the specified array index.
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
Parameters
arrayKeyValuePair<string, object>[]The one-dimensional Array that is the destination of the elements copied from MetadataDictionary. The Array must have zero-based indexing.
arrayIndexintThe zero-based index in
arrayat which copying begins.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<string, object>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<string, object>>
An enumerator that can be used to iterate through the collection.
Remove(KeyValuePair<string, object>)
Removes the first occurrence of a specific object from the MetadataDictionary.
public bool Remove(KeyValuePair<string, object> item)
Parameters
itemKeyValuePair<string, object>The object to remove from the MetadataDictionary.
Returns
- bool
true if
itemwas successfully removed from the MetadataDictionary; otherwise, false. This method also returns false ifitemis not found in the original MetadataDictionary.
Remove(string)
Removes the element with the specified key from the MetadataDictionary.
public bool Remove(string key)
Parameters
keystringThe key of the element to remove.
Returns
- bool
true if the element is successfully removed; otherwise, false. This method also returns false if
keywas not found in the original MetadataDictionary.
TryGetValue(string, out object)
Gets the value associated with the specified key.
public bool TryGetValue(string key, out object value)
Parameters
keystringThe key whose value to get.
valueobjectWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the
valueparameter. This parameter is passed uninitialized.
Returns
- bool
true if the object that implements MetadataDictionary contains an element with the specified key; otherwise, false.