Class ValueObjectInt16KeyGenerationExtensions
Namespace: AdCodicem.ValueObjects.EntityFrameworkCore
Assembly: AdCodicem.ValueObjects.EntityFrameworkCore.dll
Generates a key over a 16-bit integer the way the provider generates a
public static class ValueObjectInt16KeyGenerationExtensions
Inheritance
object ← ValueObjectInt16KeyGenerationExtensions
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
HasValueObjectKeyGeneration<TSelf>(PropertyBuilder<TSelf>)
Has the database generate the key when an entity is added: an identity column on SQL Server and PostgreSQL, the row identifier on SQLite, with a temporary value in the change tracker until the row is saved.
public static PropertyBuilder<TSelf> HasValueObjectKeyGeneration<TSelf>(this PropertyBuilder<TSelf> builder) where TSelf : struct, IValueObject<TSelf, short>
Parameters
builder PropertyBuilder<TSelf>
Property builder of the key.
Returns
PropertyBuilder<TSelf>
The same builder, so calls can be chained.
Type Parameters
TSelf
Value object type, over
Remarks
On SQL Server and PostgreSQL, the column is a smallint identity, whose values the value object's type can
hold; on SQLite, the key is the row identifier, a 64-bit integer, which outgrows the type past