共用方式為


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資料庫

適用於