MaxLengthAttributeAdapter 類別
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
提供屬性的 MaxLengthAttribute 轉接器。
public ref class MaxLengthAttributeAdapter sealed : System::Web::ModelBinding::DataAnnotationsModelValidator<System::ComponentModel::DataAnnotations::MaxLengthAttribute ^>
public sealed class MaxLengthAttributeAdapter : System.Web.ModelBinding.DataAnnotationsModelValidator<System.ComponentModel.DataAnnotations.MaxLengthAttribute>
type MaxLengthAttributeAdapter = class
inherit DataAnnotationsModelValidator<MaxLengthAttribute>
Public NotInheritable Class MaxLengthAttributeAdapter
Inherits DataAnnotationsModelValidator(Of MaxLengthAttribute)
- 繼承
-
MaxLengthAttributeAdapter
建構函式
| 名稱 | Description |
|---|---|
| MaxLengthAttributeAdapter(ModelMetadata, ModelBindingExecutionContext, MaxLengthAttribute) |
初始化 MaxLengthAttributeAdapter 類別的新執行個體。 |
屬性
| 名稱 | Description |
|---|---|
| Attribute |
取得驗證屬性。 (繼承來源 DataAnnotationsModelValidator<TAttribute>) |
| ErrorMessage |
會收到驗證失敗的錯誤訊息。 (繼承來源 DataAnnotationsModelValidator) |
| IsRequired |
會得到一個值,指示模型是否被要求(即屬性中的 Attribute 驗證屬性是否為 RequiredAttribute 屬性)。 (繼承來源 DataAnnotationsModelValidator) |
| Metadata |
當在衍生類別中實作時,會取得模型驗證器的元資料。 (繼承來源 ModelValidator) |
| ModelBindingExecutionContext |
當在派生類別中實作時,會取得執行上下文。 (繼承來源 ModelValidator) |
方法
| 名稱 | Description |
|---|---|
| Equals(Object) |
判斷指定的 物件是否等於目前的物件。 (繼承來源 Object) |
| GetHashCode() |
做為預設雜湊函式。 (繼承來源 Object) |
| GetLocalizedErrorMessage(String) |
會收到模型的局部錯誤訊息。 (繼承來源 DataAnnotationsModelValidator) |
| GetLocalizedString(String, Object[]) |
會針對特定字串取得在地版本。 (繼承來源 DataAnnotationsModelValidator) |
| GetType() |
取得目前實例的 Type。 (繼承來源 Object) |
| MemberwiseClone() |
建立目前 Object的淺層複本。 (繼承來源 Object) |
| ToString() |
傳回表示目前 物件的字串。 (繼承來源 Object) |
| Validate(Object) |
回傳模型的驗證錯誤訊息清單。 (繼承來源 DataAnnotationsModelValidator) |