IConventionEntityTypeBuilder.HasIndex 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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
否則為 。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應