Share via


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>>, String)

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

HasIndex(String[], String)

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

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

Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs

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[])

Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs
Source:
OwnedNavigationBuilder%60.cs

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

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

Source:
OwnedNavigationBuilder%60.cs

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

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)

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 }).

name
String

The name to assign to the index.

Returns

IndexBuilder<TDependentEntity>

An object that can be used to configure the index.

Applies to

HasIndex(String[], String)

Source:
OwnedNavigationBuilder%60.cs

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

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)

Parameters

propertyNames
String[]

The names of the properties that make up the index.

name
String

The name to assign to the index.

Returns

IndexBuilder<TDependentEntity>

An object that can be used to configure the index.

Applies to