Table of Contents

Class DictionaryValueProvider

Namespace
Virtufin.Core
Assembly
Virtufin.Core.dll

Values kept per (entity, attribute name), of any value types: one provider may hold a double attribute and an int attribute. Requesting a held attribute with another value type throws AttributeTypeMismatchException; a missing value is null.

public class DictionaryValueProvider : IValueProvider
Inheritance
DictionaryValueProvider
Implements
Inherited Members

Constructors

DictionaryValueProvider(IEntityAttributeValueTypeSpecifier)

public DictionaryValueProvider(IEntityAttributeValueTypeSpecifier typeSpecifier)

Parameters

typeSpecifier IEntityAttributeValueTypeSpecifier

Properties

TypeSpecifier

The entities and attributes this provider answers for.

public IEntityAttributeValueTypeSpecifier TypeSpecifier { get; }

Property Value

IEntityAttributeValueTypeSpecifier

Methods

Add<V>(IEnumerable<(IEntityIdentifier, IAttribute<V>, V)>)

Adds values; returns this provider for chaining.

public DictionaryValueProvider Add<V>(IEnumerable<(IEntityIdentifier, IAttribute<V>, V)> entries) where V : struct

Parameters

entries IEnumerable<(IEntityIdentifier, IAttribute<V>, V)>

Returns

DictionaryValueProvider

Type Parameters

V

Add<V>(IEntityIdentifier, IAttribute<V>, V)

Adds a value; returns this provider for chaining.

public DictionaryValueProvider Add<V>(IEntityIdentifier identifier, IAttribute<V> attribute, V value) where V : struct

Parameters

identifier IEntityIdentifier
attribute IAttribute<V>
value V

Returns

DictionaryValueProvider

Type Parameters

V

GetValue<V>(IEntityIdentifier, IAttribute<V>)

The value of the entity's attribute, or null when there is none.

public V? GetValue<V>(IEntityIdentifier identifier, IAttribute<V> attribute) where V : struct

Parameters

identifier IEntityIdentifier
attribute IAttribute<V>

Returns

V?

Type Parameters

V

Exceptions

AttributeTypeMismatchException

The provider holds the attribute with another value type.