語言

RequiredAttributeAdapter 類別

定義

public ref class RequiredAttributeAdapter sealed : Microsoft::AspNetCore::Mvc::DataAnnotations::AttributeAdapterBase<System::ComponentModel::DataAnnotations::RequiredAttribute ^>
public sealed class RequiredAttributeAdapter : Microsoft.AspNetCore.Mvc.DataAnnotations.AttributeAdapterBase<System.ComponentModel.DataAnnotations.RequiredAttribute>
type RequiredAttributeAdapter = class
    inherit AttributeAdapterBase<RequiredAttribute>
Public NotInheritable Class RequiredAttributeAdapter
Inherits AttributeAdapterBase(Of RequiredAttribute)
繼承

建構函式

名稱 Description
RequiredAttributeAdapter(RequiredAttribute, IStringLocalizer)

初始化 RequiredAttributeAdapter 的新執行個體。

屬性

名稱 Description
Attribute

取得 TAttribute 執行個體。

(繼承來源 ValidationAttributeAdapter<TAttribute>)

方法

名稱 Description
AddValidation(ClientModelValidationContext)

針對 RequiredAttribute 用 AttributeAdapterBase<TAttribute>。

GetErrorMessage(ModelMetadata, Object[])

取得使用 Attribute 格式化的錯誤訊息。

(繼承來源 ValidationAttributeAdapter<TAttribute>)
GetErrorMessage(ModelValidationContextBase)

取得錯誤訊息。

適用於