Share via


SqlServerModelBuilderExtensions.ForSqlServerUseIdentityColumns Method

Definition

Overloads

ForSqlServerUseIdentityColumns(ModelBuilder)

Configures the model to use the SQL Server IDENTITY feature to generate values for key properties marked as OnAdd, when targeting SQL Server. This is the default behavior when targeting SQL Server.

ForSqlServerUseIdentityColumns(ModelBuilder, Int32, Int32)
Obsolete.

Configures the model to use the SQL Server IDENTITY feature to generate values for key properties marked as OnAdd, when targeting SQL Server. This is the default behavior when targeting SQL Server.

ForSqlServerUseIdentityColumns(ModelBuilder)

Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs

Configures the model to use the SQL Server IDENTITY feature to generate values for key properties marked as OnAdd, when targeting SQL Server. This is the default behavior when targeting SQL Server.

public static Microsoft.EntityFrameworkCore.ModelBuilder ForSqlServerUseIdentityColumns (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder);
static member ForSqlServerUseIdentityColumns : Microsoft.EntityFrameworkCore.ModelBuilder -> Microsoft.EntityFrameworkCore.ModelBuilder
<Extension()>
Public Function ForSqlServerUseIdentityColumns (modelBuilder As ModelBuilder) As ModelBuilder

Parameters

modelBuilder
ModelBuilder

The model builder.

Returns

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

Applies to

ForSqlServerUseIdentityColumns(ModelBuilder, Int32, Int32)

Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs

Caution

Use UseIdentityColumns

Configures the model to use the SQL Server IDENTITY feature to generate values for key properties marked as OnAdd, when targeting SQL Server. This is the default behavior when targeting SQL Server.

[System.Obsolete("Use UseIdentityColumns")]
public static Microsoft.EntityFrameworkCore.ModelBuilder ForSqlServerUseIdentityColumns (this Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder, int seed = 1, int increment = 1);
[<System.Obsolete("Use UseIdentityColumns")>]
static member ForSqlServerUseIdentityColumns : Microsoft.EntityFrameworkCore.ModelBuilder * int * int -> Microsoft.EntityFrameworkCore.ModelBuilder
<Extension()>
Public Function ForSqlServerUseIdentityColumns (modelBuilder As ModelBuilder, Optional seed As Integer = 1, Optional increment As Integer = 1) As ModelBuilder

Parameters

modelBuilder
ModelBuilder

The model builder.

seed
Int32

The value that is used for the very first row loaded into the table.

increment
Int32

The incremental value that is added to the identity value of the previous row that was loaded.

Returns

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

Attributes

Applies to