共用方式為


IConventionEntityTypeBuilder.HasIndex 方法

定義

多載

HasIndex(IReadOnlyList<IConventionProperty>, Boolean)

在指定的屬性上設定索引。 如果給定的屬性清單中有現有的索引,則會傳回現有的索引以進行設定。

HasIndex(IReadOnlyList<String>, Boolean)

在指定的屬性名稱上設定索引。 如果給定的屬性名稱清單中有現有的索引,則會傳回現有的索引以進行設定。

HasIndex(IReadOnlyList<IConventionProperty>, String, Boolean)

使用指定的名稱,在指定的屬性上設定索引。 如果給定的屬性集和具有指定名稱的現有索引,則會針對組態傳回現有的索引。

HasIndex(IReadOnlyList<String>, String, Boolean)

在指定的屬性名稱上設定索引。 如果給定的屬性名稱清單中有現有的索引,則會傳回現有的索引以進行設定。

HasIndex(IReadOnlyList<IConventionProperty>, Boolean)

在指定的屬性上設定索引。 如果給定的屬性清單中有現有的索引,則會傳回現有的索引以進行設定。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, bool fromDataAnnotation = false);
abstract member HasIndex : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
Public Function HasIndex (properties As IReadOnlyList(Of IConventionProperty), Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder

參數

properties
IReadOnlyList<IConventionProperty>

組成索引的屬性。

fromDataAnnotation
Boolean

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

傳回

如果索引存在於實體類型上,則可用來設定索引的物件, null 否則為 。

適用於

HasIndex(IReadOnlyList<String>, Boolean)

在指定的屬性名稱上設定索引。 如果給定的屬性名稱清單中有現有的索引,則會傳回現有的索引以進行設定。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasIndex (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasIndex (System.Collections.Generic.IReadOnlyList<string> propertyNames, bool fromDataAnnotation = false);
abstract member HasIndex : System.Collections.Generic.IReadOnlyList<string> * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
Public Function HasIndex (propertyNames As IReadOnlyList(Of String), Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder

參數

propertyNames
IReadOnlyList<String>

組成索引的屬性名稱。

fromDataAnnotation
Boolean

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

傳回

如果索引存在於實體類型上,則可用來設定索引的物件, null 否則為 。

適用於

HasIndex(IReadOnlyList<IConventionProperty>, String, Boolean)

使用指定的名稱,在指定的屬性上設定索引。 如果給定的屬性集和具有指定名稱的現有索引,則會針對組態傳回現有的索引。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, string name, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasIndex (System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> properties, string name, bool fromDataAnnotation = false);
abstract member HasIndex : System.Collections.Generic.IReadOnlyList<Microsoft.EntityFrameworkCore.Metadata.IConventionProperty> * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
Public Function HasIndex (properties As IReadOnlyList(Of IConventionProperty), name As String, Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder

參數

properties
IReadOnlyList<IConventionProperty>

組成索引的屬性。

name
String

索引的名稱。

fromDataAnnotation
Boolean

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

傳回

如果索引存在於實體類型上,則可用來設定索引的物件, null 否則為 。

適用於

HasIndex(IReadOnlyList<String>, String, Boolean)

在指定的屬性名稱上設定索引。 如果給定的屬性名稱清單中有現有的索引,則會傳回現有的索引以進行設定。

public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder HasIndex (System.Collections.Generic.IReadOnlyList<string> propertyNames, string name, bool fromDataAnnotation = false);
public Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder? HasIndex (System.Collections.Generic.IReadOnlyList<string> propertyNames, string name, bool fromDataAnnotation = false);
abstract member HasIndex : System.Collections.Generic.IReadOnlyList<string> * string * bool -> Microsoft.EntityFrameworkCore.Metadata.Builders.IConventionIndexBuilder
Public Function HasIndex (propertyNames As IReadOnlyList(Of String), name As String, Optional fromDataAnnotation As Boolean = false) As IConventionIndexBuilder

參數

propertyNames
IReadOnlyList<String>

組成索引的屬性名稱。

name
String

索引的名稱。

fromDataAnnotation
Boolean

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

傳回

如果索引存在於實體類型上,則可用來設定索引的物件, null 否則為 。

適用於