ReferenceOwnershipBuilder<TEntity,TRelatedEntity>.HasIndex Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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<TRelatedEntity,object>> indexExpression);
override this.HasIndex : System.Linq.Expressions.Expression<Func<'RelatedEntity, obj>> -> Microsoft.EntityFrameworkCore.Metadata.Builders.IndexBuilder
Public Overridable Function HasIndex (indexExpression As Expression(Of Func(Of TRelatedEntity, Object))) As IndexBuilder
Parameters
- indexExpression
- Expression<Func<TRelatedEntity,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
An object that can be used to configure the index.
Applies to
Entity Framework