Udostępnij za pośrednictwem


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

Name Value Description
None 0

No SQL Server-specific strategy

SequenceHiLo 1

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

IdentityColumn 2

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

Sequence 3

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

Remarks

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

Applies to