Class ValueObjectKeyGeneratorFactory<TSelf, TValue>
Namespace: AdCodicem.ValueObjects.EntityFrameworkCore
Assembly: AdCodicem.ValueObjects.EntityFrameworkCore.dll
Creates the generator HasValueObjectKeyGeneration gives a key, by a type a compiled model can instantiate:
GUIDs a database keeps in order for a key over
public sealed class ValueObjectKeyGeneratorFactory<TSelf, TValue> : ValueGeneratorFactory where TSelf : struct, IValueObject<TSelf, TValue>
Type Parameters
TSelf
Value object type.
TValue
Underlying value type: HasValueObjectKeyGeneration is declared for.
Inheritance
object ← ValueGeneratorFactory ← ValueObjectKeyGeneratorFactory<TSelf, TValue>
Inherited Members
ValueGeneratorFactory.Create(IProperty, ITypeBase), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()
Remarks
A GUID is SQL Server's sequential one on SQL Server (Create, so a rule
the GUID breaks fails the add with the value object's
An integer is a temporary value, negative, which the change tracker holds until SaveChanges, when the
database's identity takes its place. It is never written, so it is created unchecked, and a type counted from one
accepts it, a strict context included; the key the database hands back is read through the converter. Only a
relational database generates it: on another provider, Entity Framework Core's in-memory database for one, the add
fails with an
HasValueObjectKeyGeneration sets it on the property, and a compiled model writes it as
new ValueObjectKeyGeneratorFactory<TSelf, TValue>().Create.
Methods
Create(IProperty, ITypeBase)
Creates a new value generator.
public override ValueGenerator Create(IProperty property, ITypeBase typeBase)
Parameters
property IProperty
The property to create the value generator for.
typeBase ITypeBase
The type for which the value generator will be used.
Returns
The newly created value generator.
Remarks
See EF Core value generation for more information and examples.