共用方式為


ForeignKeyIndexConvention.CreateIndex 方法

定義

建立 IConventionIndex

protected virtual Microsoft.EntityFrameworkCore.Metadata.IConventionIndex CreateIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool unique, Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder);
protected virtual Microsoft.EntityFrameworkCore.Metadata.IConventionIndex? CreateIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool unique, Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder entityTypeBuilder);
abstract member CreateIndex : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool * Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder -> Microsoft.EntityFrameworkCore.Metadata.IConventionIndex
override this.CreateIndex : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool * Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionEntityTypeBuilder -> Microsoft.EntityFrameworkCore.Metadata.IConventionIndex
Protected Overridable Function CreateIndex (properties As IReadOnlyList(Of IConventionProperty), unique As Boolean, entityTypeBuilder As IConventionEntityTypeBuilder) As IConventionIndex

參數

properties
IReadOnlyList<IConventionProperty>

構成索引的屬性。

unique
Boolean

要建立的索引是否應是唯一的。

entityTypeBuilder
IConventionEntityTypeBuilder

實體類型的產生器。

傳回

已建立的索引。

適用於