語言

OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.HasIndex 方法

定義

多載

名稱 Description
HasIndex(Expression<Func<TDependentEntity,Object>>)

在指定屬性上設定索引。 如果在給定屬性集合上存在現有索引,則該現有索引將被回傳用於配置。

HasIndex(String[])

在指定屬性上設定索引。 如果在給定屬性集合上存在現有索引,則該現有索引將被回傳用於配置。

HasIndex(Expression<Func<TDependentEntity,Object>>, String)

以指定屬性為標示名稱的索引。 如果在給定屬性清單中存在且名稱相同的索引,則該現有索引將被回傳用於配置。

HasIndex(String[], String)

以指定屬性為標示名稱的索引。 如果在給定屬性清單中存在且名稱相同的索引,則該現有索引將被回傳用於配置。

HasIndex(Expression<Func<TDependentEntity,Object>>)

來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs

在指定屬性上設定索引。 如果在給定屬性集合上存在現有索引,則該現有索引將被回傳用於配置。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TDependentEntity> HasIndex(System.Linq.Expressions.Expression<Func<TDependentEntity,object?>> indexExpression);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder HasIndex(System.Linq.Expressions.Expression<Func<TDependentEntity,object>> indexExpression);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> HasIndex(System.Linq.Expressions.Expression<Func<TDependentEntity,object>> indexExpression);
override this.HasIndex : System.Linq.Expressions.Expression<Func<'DependentEntity, obj>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'DependentEntity (requires 'DependentEntity : null)>
override this.HasIndex : System.Linq.Expressions.Expression<Func<'DependentEntity, obj>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder
override this.HasIndex : System.Linq.Expressions.Expression<Func<'DependentEntity, obj>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function HasIndex (indexExpression As Expression(Of Func(Of TDependentEntity, Object))) As IndexBuilder(Of TDependentEntity)
Public Overridable Function HasIndex (indexExpression As Expression(Of Func(Of TDependentEntity, Object))) As IndexBuilder
Public Overridable Function HasIndex (indexExpression As Expression(Of Func(Of TDependentEntity, Object))) As IndexBuilder(Of TEntity)

參數

indexExpression
Expression<Func<TDependentEntity,Object>>

一個表示要包含在索引中屬性的 lambda 表達式。blog => blog.Url

若索引由多個屬性組成,則指定包含屬性(post => new { post.Title, post.BlogId })的匿名型別。

傳回

IndexBuilder<TDependentEntity>
IndexBuilder<TEntity>

一個可以用來設定索引的物件。

適用於

HasIndex(String[])

來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs

在指定屬性上設定索引。 如果在給定屬性集合上存在現有索引,則該現有索引將被回傳用於配置。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TDependentEntity> HasIndex(params string[] propertyNames);
public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TEntity> HasIndex(params string[] propertyNames);
override this.HasIndex : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'DependentEntity (requires 'DependentEntity : null)>
override this.HasIndex : string[] -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'Entity (requires 'Entity : null)>
Public Overridable Function HasIndex (ParamArray propertyNames As String()) As IndexBuilder(Of TDependentEntity)
Public Overridable Function HasIndex (ParamArray propertyNames As String()) As IndexBuilder(Of TEntity)

參數

propertyNames
String[]

組成索引的屬性名稱。

傳回

IndexBuilder<TDependentEntity>
IndexBuilder<TEntity>

一個可以用來設定索引的物件。

適用於

HasIndex(Expression<Func<TDependentEntity,Object>>, String)

來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs

以指定屬性為標示名稱的索引。 如果在給定屬性清單中存在且名稱相同的索引,則該現有索引將被回傳用於配置。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TDependentEntity> HasIndex(System.Linq.Expressions.Expression<Func<TDependentEntity,object?>> indexExpression, string name);
override this.HasIndex : System.Linq.Expressions.Expression<Func<'DependentEntity, obj>> * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'DependentEntity (requires 'DependentEntity : null)>
Public Overridable Function HasIndex (indexExpression As Expression(Of Func(Of TDependentEntity, Object)), name As String) As IndexBuilder(Of TDependentEntity)

參數

indexExpression
Expression<Func<TDependentEntity,Object>>

一個表示要包含在索引中屬性的 lambda 表達式。blog => blog.Url

若索引由多個屬性組成,則指定包含屬性(post => new { post.Title, post.BlogId })的匿名型別。

name
String

指派給索引的名稱。

傳回

IndexBuilder<TDependentEntity>

一個可以用來設定索引的物件。

適用於

HasIndex(String[], String)

來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs
來源:
OwnedNavigationBuilder`.cs

以指定屬性為標示名稱的索引。 如果在給定屬性清單中存在且名稱相同的索引,則該現有索引將被回傳用於配置。

public virtual Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<TDependentEntity> HasIndex(string[] propertyNames, string name);
override this.HasIndex : string[] * string -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder<'DependentEntity (requires 'DependentEntity : null)>
Public Overridable Function HasIndex (propertyNames As String(), name As String) As IndexBuilder(Of TDependentEntity)

參數

propertyNames
String[]

組成索引的屬性名稱。

name
String

指派給索引的名稱。

傳回

IndexBuilder<TDependentEntity>

一個可以用來設定索引的物件。

適用於