閱讀英文版本

分享方式:


IndexAttribute 類別

定義

指定要在資料庫中產生的索引。

C#
[System.AttributeUsage(System.AttributeTargets.Class, AllowMultiple=true)]
public sealed class IndexAttribute : Attribute
繼承
IndexAttribute
屬性

備註

如需詳細資訊和範例,請參閱 模型化實體類型和關聯 性。

建構函式

IndexAttribute(String, String[])

初始化 IndexAttribute 類別的新執行個體。

IndexAttribute(String[])
已淘汰.

初始化 IndexAttribute 類別的新執行個體。

屬性

AllDescending

所有索引資料行是否都有遞減排序次序。

IsDescending

一組值,指出每個對應的索引資料行是否有遞減排序次序。

IsUnique

索引是否是唯一的。

IsUniqueHasValue

檢查是否已 IsUnique 明確設定為 值。

Name

索引的名稱。

PropertyNames

依序構成索引的屬性。

適用於

產品 版本
Entity Framework Core 5.0, 6.0, 7.0, 8.0, 9.0