Delen via


SqlServerModelBuilderExtensions.UseKeySequences Method

Definition

Configures the model to use a sequence per hierarchy to generate values for key properties marked as OnAdd, when targeting SQL Server.

public static Microsoft.EntityFrameworkCore.ModelBuilder UseKeySequences (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, string? nameSuffix = default, string? schema = default);
static member UseKeySequences : Microsoft.EntityFrameworkCore.ModelBuilder * string * string -> Microsoft.EntityFrameworkCore.ModelBuilder
<Extension()>
Public Function UseKeySequences (modelBuilder As ModelBuilder, Optional nameSuffix As String = Nothing, Optional schema As String = Nothing) As ModelBuilder

Parameters

modelBuilder
ModelBuilder

The model builder.

nameSuffix
String

The name that will suffix the table name for each sequence created automatically.

schema
String

The schema of the sequence.

Returns

The same builder instance so that multiple calls can be chained.

Remarks

See Modeling entity types and relationships, and Accessing SQL Server and Azure SQL databases with EF Core for more information and examples.

Applies to