Class StrictValueObjectConverter<TSelf, TValue>
Namespace: AdCodicem.ValueObjects.EntityFrameworkCore
Assembly: AdCodicem.ValueObjects.EntityFrameworkCore.dll
Stores a value object as its bare underlying value, and re-validates whatever comes back from the database.
public sealed class StrictValueObjectConverter<TSelf, TValue> : ValueConverter<TSelf, TValue> where TSelf : struct, IValueObject<TSelf, TValue>
Type Parameters
TSelf
Value object type.
TValue
Underlying value type.
Inheritance
object ← ValueConverter ← ValueConverter<TSelf, TValue> ← StrictValueObjectConverter<TSelf, TValue>
Inherited Members
ValueConverter<TSelf, TValue>.ConvertToProvider, ValueConverter<TSelf, TValue>.ConvertFromProvider, ValueConverter<TSelf, TValue>.ConvertToProviderTyped, ValueConverter<TSelf, TValue>.ConvertFromProviderTyped, ValueConverter<TSelf, TValue>.ConvertToProviderExpression, ValueConverter<TSelf, TValue>.ConvertFromProviderExpression, ValueConverter<TSelf, TValue>.ModelClrType, ValueConverter<TSelf, TValue>.ProviderClrType, ValueConverter<TSelf, TValue>.ConstructorExpression, ValueConverter.ComposeWith(ValueConverter?), ValueConverter.ConvertToProvider, ValueConverter.ConvertFromProvider, ValueConverter.ConvertToProviderExpression, ValueConverter.ConvertFromProviderExpression, ValueConverter.ModelClrType, ValueConverter.ProviderClrType, ValueConverter.MappingHints, ValueConverter.ConvertsNulls, ValueConverter.ConstructorExpression, object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
Pays normalization and validation on every materialized row. Worth it when the table is shared with another writer — a legacy application, an ETL job, a migration script — and a row may therefore hold a value the domain would refuse.
Constructors
StrictValueObjectConverter()
Initializes a new instance of the
public StrictValueObjectConverter()