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
-
IDictionary<String, Object>ICollection<KeyValuePair<String, Object>>IEnumerable<KeyValuePair<String, Object>>IEnumerable
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
- String
CausationId
CausationId is a reserved keyword.
public const string CausationId = "CausationId"
Field Value
- String
CorrelationId
CorrelationId is a reserved keyword.
public const string CorrelationId = "CorrelationId"
Field Value
- String
EventId
EventId is a reserved keyword.
public const string EventId = "EventId"
Field Value
- String
MemberType
MemberType is a reserved keyword.
public const string MemberType = "MemberType"
Field Value
- String
RequestId
RequestId is a reserved keyword.
public const string RequestId = "RequestId"
Field Value
- String
Timestamp
Timestamp is a reserved keyword.
public const string Timestamp = "Timestamp"
Field Value
- String
Properties
Count
Gets the number of elements contained in the MetadataDictionary.
public int Count { get; }
Property Value
- Int32
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
- Boolean
true
if this instance is read only; otherwise,false
.
Item[String]
Gets or sets the element with the specified key.
public object this[string key] { get; set; }
Parameters
key
StringThe key of the value to get or set.
Property Value
- Object
The value associated with the specified key.
Keys
Gets an System.Collections.Generic.ICollection<T> containing the keys of the MetadataDictionary.
public ICollection<string> Keys { get; }
Property Value
- ICollection<String>
A System.Collections.Generic.Dictionary`2.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 System.Collections.Generic.ICollection<T> containing the values in the MetadataDictionary.
public ICollection<object> Values { get; }
Property Value
- ICollection<Object>
A System.Collections.Generic.Dictionary`2.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
item
KeyValuePair<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
key
StringThe object to use as the key of the element to add.
value
ObjectThe 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
item
KeyValuePair<String, Object>The object to locate in the MetadataDictionary.
Returns
- Boolean
true if
item
is 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
key
StringThe key to locate in the MetadataDictionary.
Returns
- Boolean
true if the MetadataDictionary contains an element with the key; otherwise, false.
CopyTo(KeyValuePair<String, Object>[], Int32)
Copies the elements of the MetadataDictionary to an array of type System.Collections.Generic.KeyValuePair<TKey, TValue>, starting at the specified array index.
public void CopyTo(KeyValuePair<string, object>[] array, int arrayIndex)
Parameters
array
KeyValuePair<String, Object>[]The one-dimensional System.Array that is the destination of the elements copied from MetadataDictionary. The System.Array must have zero-based indexing.
arrayIndex
Int32The zero-based index in
array
at 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
item
KeyValuePair<String, Object>The object to remove from the MetadataDictionary.
Returns
- Boolean
true if
item
was successfully removed from the MetadataDictionary; otherwise, false. This method also returns false ifitem
is not found in the original MetadataDictionary.
Remove(String)
Removes the element with the specified key from the MetadataDictionary.
public bool Remove(string key)
Parameters
key
StringThe key of the element to remove.
Returns
- Boolean
true if the element is successfully removed; otherwise, false. This method also returns false if
key
was 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
key
StringThe key whose value to get.
value
ObjectWhen this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the
value
parameter. This parameter is passed uninitialized.
Returns
- Boolean
true if the object that implements MetadataDictionary contains an element with the specified key; otherwise, false.
Explicit Interface Implementations
IEnumerable.GetEnumerator()
Returns an enumerator that iterates through a collection.
IEnumerator IEnumerable.GetEnumerator()
Returns
- IEnumerator
An System.Collections.IEnumerator object that can be used to iterate through the collection.