IndexAttribute 類別
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定要在資料庫中產生的索引。
C#
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)]
public sealed class IndexAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)>]
type IndexAttribute = class
inherit Attribute
Public NotInheritable Class IndexAttribute
Inherits Attribute
- 繼承
-
IndexAttribute
- 屬性
如需詳細資訊和範例,請參閱 模型化實體類型和關聯 性。
Index |
初始化 IndexAttribute 類別的新執行個體。 |
Index |
已淘汰.
初始化 IndexAttribute 類別的新執行個體。 |
All |
所有索引資料行是否都有遞減排序次序。 |
Is |
一組值,指出每個對應的索引資料行是否有遞減排序次序。 |
Is |
索引是否是唯一的。 |
Is |
檢查是否已 IsUnique 明確設定為 值。 |
Name |
索引的名稱。 |
Property |
依序構成索引的屬性。 |
產品 | 版本 |
---|---|
Entity Framework Core | 5.0, 6.0, 7.0, 8.0, 9.0 |