SqlServerModelBuilderExtensions.HasHiLoSequence 方法

定义

将用于 hi-lo 模式的数据库序列配置为在面向 SQL Server 时生成标记为 OnAdd的键属性的值。

public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionSequenceBuilder HasHiLoSequence (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string name, string schema, bool fromDataAnnotation = false);
public static Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionSequenceBuilder? HasHiLoSequence (this Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder modelBuilder, string? name, string? schema, bool fromDataAnnotation = false);
static member HasHiLoSequence : Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionModelBuilder * string * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionSequenceBuilder
<Extension()>
Public Function HasHiLoSequence (modelBuilder As IConventionModelBuilder, name As String, schema As String, Optional fromDataAnnotation As Boolean = false) As IConventionSequenceBuilder

参数

modelBuilder
IConventionModelBuilder

模型生成器。

name
String

序列的名称。

schema
String

序列的架构。

fromDataAnnotation
Boolean

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

返回

用于进一步配置序列的生成器。

注解

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

适用于