语言

SqlServerModelBuilderExtensions.HasIdentityColumnSeed 方法

定义

重载

名称 说明
HasIdentityColumnSeed(IConventionModelBuilder, Nullable<Int32>, Boolean)

为 SQL Server IDENTITY 配置默认种子。

HasIdentityColumnSeed(IConventionModelBuilder, Nullable<Int64>, Boolean)

为 SQL Server IDENTITY 配置默认种子。

HasIdentityColumnSeed(IConventionModelBuilder, Nullable<Int32>, Boolean)

Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs

为 SQL Server IDENTITY 配置默认种子。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder HasIdentityColumnSeed(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, int? seed, bool fromDataAnnotation = false);
static member HasIdentityColumnSeed : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder * Nullable<int> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder
<Extension()>
Public Function HasIdentityColumnSeed (modelBuilder As IConventionModelBuilder, seed As Nullable(Of Integer), Optional fromDataAnnotation As Boolean = false) As IConventionModelBuilder

参数

modelBuilder
IConventionModelBuilder

模型生成器。

seed
Nullable<Int32>

加载到表中的第一个行所使用的值。

fromDataAnnotation
Boolean

指示是否使用数据注释指定了配置。

返回

如果应用了配置,则为同一生成器实例, null 否则为同一个生成器实例。

适用于

HasIdentityColumnSeed(IConventionModelBuilder, Nullable<Int64>, Boolean)

Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs
Source:
SqlServerModelBuilderExtensions.cs

为 SQL Server IDENTITY 配置默认种子。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder? HasIdentityColumnSeed(this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, long? seed, bool fromDataAnnotation = false);
static member HasIdentityColumnSeed : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder * Nullable<int64> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder
<Extension()>
Public Function HasIdentityColumnSeed (modelBuilder As IConventionModelBuilder, seed As Nullable(Of Long), Optional fromDataAnnotation As Boolean = false) As IConventionModelBuilder

参数

modelBuilder
IConventionModelBuilder

模型生成器。

seed
Nullable<Int64>

加载到表中的第一个行所使用的值。

fromDataAnnotation
Boolean

指示是否使用数据注释指定了配置。

返回

如果应用了配置,则为同一生成器实例, null 否则为同一个生成器实例。

注解

有关详细信息和示例,请参阅建模实体类型和关系,以及使用 EF Core 访问SQL Server和Azure SQL数据库。

适用于