OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.HasIndex 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
重载
| 名称 | 说明 |
|---|---|
| HasIndex(Expression<Func<TDependentEntity,Object>>) |
在指定属性上配置索引。 如果给定的属性集上存在现有索引,则会为配置返回现有索引。 |
| HasIndex(String[]) |
在指定属性上配置索引。 如果给定的属性集上存在现有索引,则会为配置返回现有索引。 |
| HasIndex(Expression<Func<TDependentEntity,Object>>, String) |
使用给定名称在指定属性上配置索引。 如果给定的属性列表和具有给定名称的现有索引,则会为配置返回现有索引。 |
| HasIndex(String[], String) |
使用给定名称在指定属性上配置索引。 如果给定的属性列表和具有给定名称的现有索引,则会为配置返回现有索引。 |
HasIndex(Expression<Func<TDependentEntity,Object>>)
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- 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.Urls)。
如果索引由多个属性组成,则指定一个匿名类型,包括属性(post => new { post.Title, post.BlogId })。
返回
可用于配置索引的对象。
适用于
HasIndex(String[])
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- 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[]
构成索引的属性的名称。
返回
可用于配置索引的对象。
适用于
HasIndex(Expression<Func<TDependentEntity,Object>>, String)
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- 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.Urls)。
如果索引由多个属性组成,则指定一个匿名类型,包括属性(post => new { post.Title, post.BlogId })。
- name
- String
要分配给索引的名称。
返回
可用于配置索引的对象。
适用于
HasIndex(String[], String)
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- OwnedNavigationBuilder`.cs
- Source:
- 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
要分配给索引的名称。
返回
可用于配置索引的对象。