Skip to main content
Version: 0.3.x (0.3.0)

Class ValueObjectInt64KeyGenerationExtensions

Namespace: AdCodicem.ValueObjects.EntityFrameworkCore
Assembly: AdCodicem.ValueObjects.EntityFrameworkCore.dll

Generates a key over a 64-bit integer the way the provider generates a key.

public static class ValueObjectInt64KeyGenerationExtensions

Inheritance​

object ← ValueObjectInt64KeyGenerationExtensions

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, long>

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​

The column is a bigint identity on SQL Server and PostgreSQL. See for what generation changes.