OwnedNavigationBuilder<TOwnerEntity,TDependentEntity>.HasIndex Method

Definition

Overloads

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

Configures an index on the specified properties. If there is an existing index on the given set of properties, then the existing index will be returned for configuration.

HasIndex(String[])

Configures an index on the specified properties. If there is an existing index on the given set of properties, then the existing index will be returned for configuration.

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

Configures an index on the specified properties. If there is an existing index on the given set of properties, then the existing index will be returned for configuration.

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

Parameters

indexExpression
Expression<Func<TDependentEntity,Object>>

A lambda expression representing the property(s) to be included in the index (blog => blog.Url).

If the index is made up of multiple properties then specify an anonymous type including the properties (post => new { post.Title, post.BlogId }).

Returns

IndexBuilder<TEntity>
IndexBuilder<TDependentEntity>

An object that can be used to configure the index.

Applies to

HasIndex(String[])

Configures an index on the specified properties. If there is an existing index on the given set of properties, then the existing index will be returned for configuration.

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

Parameters

propertyNames
String[]

The names of the properties that make up the index.

Returns

IndexBuilder<TEntity>
IndexBuilder<TDependentEntity>

An object that can be used to configure the index.

Applies to