EntityTypeConfiguration<TEntityType>.HasIndex<TIndex> 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
設定此實體類型的索引屬性 (s) 。
[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
類型參數
- TIndex
索引的類型。
參數
- indexExpression
- Expression<Func<TEntityType,TIndex>>
Lambda 運算式,表示要套用索引的屬性。 C#: t = > t.Id VB.Net:函式 (t) t.Id 如果索引是由多個屬性組成,則指定匿名型別,包括屬性。 C#: t = > new { t.Id1, t.Id2 } VB.Net: Function (t) New with { t.Id1, t.Id2 }
傳回
IndexConfiguration 實例,以便進一步設定索引。
- 屬性