Class RelationshipTree<TValue>
- Namespace
- The.Relationships
- Assembly
- Instagile.dll
public sealed class RelationshipTree<TValue> : IReadOnlyDictionary<RelationshipPath, TValue>, IReadOnlyCollection<KeyValuePair<RelationshipPath, TValue>>, IEnumerable<KeyValuePair<RelationshipPath, TValue>>, IRelationshipTree<RelationshipTree<TValue>>, IReadOnlyDictionary<RelationshipInfo, RelationshipTree<TValue>>, IReadOnlyCollection<KeyValuePair<RelationshipInfo, RelationshipTree<TValue>>>, IEnumerable<KeyValuePair<RelationshipInfo, RelationshipTree<TValue>>>, IEnumerable
Type Parameters
TValue
- Inheritance
-
RelationshipTree<TValue>
- Implements
-
IReadOnlyDictionary<RelationshipPath, TValue>IRelationshipTree<RelationshipTree<TValue>>
- Inherited Members
Constructors
RelationshipTree(IEntityInfo, TValue?)
public RelationshipTree(IEntityInfo type, TValue? value = default)
Parameters
typeIEntityInfovalueTValue
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[RelationshipInfo]
Gets the element that has the specified key in the read-only dictionary.
public RelationshipTree<TValue> this[RelationshipInfo key] { get; }
Parameters
keyRelationshipInfoThe key to locate.
Property Value
- RelationshipTree<TValue>
The element that has the specified key in the read-only dictionary.
Exceptions
- ArgumentNullException
keyis null.- KeyNotFoundException
The property is retrieved and
keyis not found.
this[RelationshipPath]
Gets the element that has the specified key in the read-only dictionary.
public TValue this[RelationshipPath key] { get; }
Parameters
keyRelationshipPathThe key to locate.
Property Value
- TValue
The element that has the specified key in the read-only dictionary.
Exceptions
- ArgumentNullException
keyis null.- KeyNotFoundException
The property is retrieved and
keyis not found.
Keys
Gets an enumerable collection that contains the keys in the read-only dictionary.
public IEnumerable<RelationshipInfo> Keys { get; }
Property Value
- IEnumerable<RelationshipInfo>
An enumerable collection that contains the keys in the read-only dictionary.
Metadata
public IEntityInfo Metadata { get; }
Property Value
Value
public TValue? Value { get; set; }
Property Value
- TValue
Values
Gets an enumerable collection that contains the values in the read-only dictionary.
public IEnumerable<RelationshipTree<TValue>> Values { get; }
Property Value
- IEnumerable<RelationshipTree<TValue>>
An enumerable collection that contains the values in the read-only dictionary.
Methods
Add(RelationshipPath, TValue)
public void Add(RelationshipPath path, TValue value)
Parameters
pathRelationshipPathvalueTValue
ContainsKey(RelationshipInfo)
Determines whether the read-only dictionary contains an element that has the specified key.
public bool ContainsKey(RelationshipInfo key)
Parameters
keyRelationshipInfoThe key to locate.
Returns
- bool
true if the read-only dictionary contains an element that has the specified key; otherwise, false.
Exceptions
- ArgumentNullException
keyis null.
ContainsKey(RelationshipPath)
Determines whether the read-only dictionary contains an element that has the specified key.
public bool ContainsKey(RelationshipPath key)
Parameters
keyRelationshipPathThe key to locate.
Returns
- bool
true if the read-only dictionary contains an element that has the specified key; otherwise, false.
Exceptions
- ArgumentNullException
keyis null.
GetEnumerator()
Returns an enumerator that iterates through the collection.
public IEnumerator<KeyValuePair<RelationshipInfo, RelationshipTree<TValue>>> GetEnumerator()
Returns
- IEnumerator<KeyValuePair<RelationshipInfo, RelationshipTree<TValue>>>
An enumerator that can be used to iterate through the collection.
Prepend(RelationshipInfo)
public RelationshipTree<TValue> Prepend(RelationshipInfo relationship)
Parameters
relationshipRelationshipInfo
Returns
- RelationshipTree<TValue>
TryGetValue(RelationshipInfo, out RelationshipTree<TValue>)
Gets the value that is associated with the specified key.
public bool TryGetValue(RelationshipInfo key, out RelationshipTree<TValue> value)
Parameters
keyRelationshipInfoThe key to locate.
valueRelationshipTree<TValue>When 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 the IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false.
Exceptions
- ArgumentNullException
keyis null.
TryGetValue(RelationshipPath, out TValue)
Gets the value that is associated with the specified key.
public bool TryGetValue(RelationshipPath key, out TValue value)
Parameters
keyRelationshipPathThe key to locate.
valueTValueWhen 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 the IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false.
Exceptions
- ArgumentNullException
keyis null.