Table of Contents

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
Inherited Members

Constructors

RelationshipTree(IEntityInfo, TValue?)

public RelationshipTree(IEntityInfo type, TValue? value = default)

Parameters

type IEntityInfo
value TValue

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

key RelationshipInfo

The key to locate.

Property Value

RelationshipTree<TValue>

The element that has the specified key in the read-only dictionary.

Exceptions

ArgumentNullException

key is null.

KeyNotFoundException

The property is retrieved and key is not found.

this[RelationshipPath]

Gets the element that has the specified key in the read-only dictionary.

public TValue this[RelationshipPath key] { get; }

Parameters

key RelationshipPath

The key to locate.

Property Value

TValue

The element that has the specified key in the read-only dictionary.

Exceptions

ArgumentNullException

key is null.

KeyNotFoundException

The property is retrieved and key is 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

IEntityInfo

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

path RelationshipPath
value TValue

ContainsKey(RelationshipInfo)

Determines whether the read-only dictionary contains an element that has the specified key.

public bool ContainsKey(RelationshipInfo key)

Parameters

key RelationshipInfo

The key to locate.

Returns

bool

true if the read-only dictionary contains an element that has the specified key; otherwise, false.

Exceptions

ArgumentNullException

key is null.

ContainsKey(RelationshipPath)

Determines whether the read-only dictionary contains an element that has the specified key.

public bool ContainsKey(RelationshipPath key)

Parameters

key RelationshipPath

The key to locate.

Returns

bool

true if the read-only dictionary contains an element that has the specified key; otherwise, false.

Exceptions

ArgumentNullException

key is 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

relationship RelationshipInfo

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

key RelationshipInfo

The key to locate.

value RelationshipTree<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 value parameter. 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

key is null.

TryGetValue(RelationshipPath, out TValue)

Gets the value that is associated with the specified key.

public bool TryGetValue(RelationshipPath key, out TValue value)

Parameters

key RelationshipPath

The key to locate.

value 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 value parameter. 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

key is null.