Share via


SqlServerValueGenerationStrategy Enum

Definition

Defines two strategies to use across the EF Core stack when generating key values from SQL Server database columns.

public enum SqlServerValueGenerationStrategy
type SqlServerValueGenerationStrategy = 
Public Enum SqlServerValueGenerationStrategy
Inheritance
SqlServerValueGenerationStrategy

Fields

IdentityColumn 2

A pattern that uses a normal SQL Server Identity column in the same way as EF6 and earlier.

None 0

No SQL Server-specific strategy

Sequence 3

A pattern that uses a database sequence to generate values for the column.

SequenceHiLo 1

A sequence-based hi-lo pattern where blocks of IDs are allocated from the server and used client-side for generating keys.

Remarks

See Model building conventions, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.

Applies to