EntityTypeConfiguration<TEntityType>.HasIndex<TIndex> 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 index property(s) for this entity type.
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1006:DoNotNestGenericTypesInMemberSignatures")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1011:ConsiderPassingBaseTypesAsParameters")]
public System.Data.Entity.ModelConfiguration.Configuration.IndexConfiguration HasIndex<TIndex> (System.Linq.Expressions.Expression<Func<TEntityType,TIndex>> indexExpression);
member this.HasIndex : System.Linq.Expressions.Expression<Func<'EntityType, 'Index>> -> System.Data.Entity.ModelConfiguration.Configuration.IndexConfiguration
Public Function HasIndex(Of TIndex) (indexExpression As Expression(Of Func(Of TEntityType, TIndex))) As IndexConfiguration
Type Parameters
- TIndex
The type of the index.
Parameters
- indexExpression
- Expression<Func<TEntityType,TIndex>>
A lambda expression representing the property to apply an index to. C#: t => t.Id VB.Net: Function(t) t.Id If the index is made up of multiple properties then specify an anonymous type including the properties. C#: t => new { t.Id1, t.Id2 } VB.Net: Function(t) New With { t.Id1, t.Id2 }
Returns
The IndexConfiguration instance so that the index can be further configured.
- Attributes
Applies to
Entity Framework