ConventionEntityTypeExtensions.AddIndex 方法

定義

將索引加入至這個實體類型。

public static Microsoft.EntityFrameworkCore.Metadata.IConventionIndex AddIndex (this Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType entityType, Microsoft.EntityFrameworkCore.Metadata.IConventionProperty property, bool fromDataAnnotation = false);
static member AddIndex : Microsoft.EntityFrameworkCore.Metadata.IConventionEntityType * Microsoft.EntityFrameworkCore.Metadata.IConventionProperty * bool -> Microsoft.EntityFrameworkCore.Metadata.IConventionIndex
<Extension()>
Public Function AddIndex (entityType As IConventionEntityType, property As IConventionProperty, Optional fromDataAnnotation As Boolean = false) As IConventionIndex

參數

entityType
IConventionEntityType

實體類型。

property
IConventionProperty

要編制索引的屬性。

fromDataAnnotation
Boolean

指出是否已使用資料批註指定組態。

傳回

新建立的索引。

適用於