System.ComponentModel.DataAnnotations 命名空間

提供屬性類別,這些類別可用來定義 ASP.NET MVC 和 ASP.NET 資料控制項的中繼資料。

類別

AllowedValuesAttribute

指定屬性中應允許的值清單。

AssociatedMetadataTypeTypeDescriptionProvider

會以加入於關聯類別中定義之屬性 (Attribute) 及屬性 (Property) 資訊的方式,延伸類別中繼資料的資訊。

AssociationAttribute

指定實體成員代表資料關聯性,例如外部索引鍵關聯性。

Base64StringAttribute

指定資料欄值是格式正確的 Base64 字串。

BindableTypeAttribute

指定型別是否通常使用於繫結。

CompareAttribute

提供比較兩個屬性 (Property) 的屬性 (Attribute)。

ConcurrencyCheckAttribute

指定屬性參與開放式並行存取檢查。

CreditCardAttribute

指定資料欄位值為信用卡號碼。

CustomValidationAttribute

指定用來驗證屬性或類別執行個體的自訂驗證方法。

DataTypeAttribute

指定要與資料欄位產生關聯的其他類型名稱。

DeniedValuesAttribute

指定屬性中不應允許的值清單。

DisplayAttribute

提供一般用途屬性,可讓您為實體部分類別的類型和成員指定可當地語系化的字串。

DisplayColumnAttribute

將所參考資料表中顯示的資料行指定為外部索引鍵資料行。

DisplayFormatAttribute

指定 ASP.NET Dynamic Data 顯示和格式化資料欄位的方式。

EditableAttribute

表示是否可以編輯資料欄位。

EmailAddressAttribute

驗證電子郵件地址。

EnumDataTypeAttribute

讓 .NET 列舉對應至資料行。

FileExtensionsAttribute

驗證副檔名。

FilterUIHintAttribute

代表用來指定資料行篩選行為的屬性。

KeyAttribute

表示唯一識別實體的一或多個屬性。

LengthAttribute

指定屬性中允許之集合/字串資料的最小和最大長度。

MaxLengthAttribute

指定屬性中所允許之陣列或字串資料的最大長度。

MetadataTypeAttribute

指定與資料模型類別產生關聯的中繼資料類別。

MinLengthAttribute

指定屬性中所允許之陣列或字串資料的最小長度。

PhoneAttribute

指定資料欄位值為語式正確的電話號碼。

RangeAttribute

指定資料欄位值的數值範圍條件約束。

RegularExpressionAttribute

指定 ASP.NET Dynamic Data 中的資料欄位值必須符合指定的規則運算式 (Regular Expression)。

RequiredAttribute

指定資料欄位值為必要。

ScaffoldColumnAttribute

指定類別或資料行是否使用 Scaffolding。

ScaffoldTableAttribute

指定類別或資料的資料表 (Data Table) 是否使用 Scaffolding。

StringLengthAttribute

指定資料欄位中允許的最小和最大字元長度。

TimestampAttribute

將資料行的資料類型指定為資料列版本。

UIHintAttribute

指定 Dynamic Data 用來顯示資料欄位的範本或使用者控制項。

UrlAttribute

提供 URL 驗證。

ValidationAttribute

做為所有驗證屬性的基底類別。

ValidationContext

描述要在其中執行驗證檢查的內容。

ValidationException

表示使用 ValidationAttribute 類別驗證資料欄位時發生的例外狀況 (Exception)。

ValidationResult

代表驗證要求結果的容器。

Validator

定義 Helper 類別,包含在相關聯的 ValidationAttribute 屬性內時,可用來驗證物件、屬性和方法。

介面

IValidatableObject

提供一種方式來驗證物件。

列舉

DataType

代表與資料欄位和參數關聯的資料類型列舉。