Share via


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)
继承

构造函数

RequiredAttributeAdapter(RequiredAttribute, IStringLocalizer)

初始化 RequiredAttributeAdapter 的新实例。

属性

Attribute

获取 TAttribute 实例。

(继承自 ValidationAttributeAdapter<TAttribute>)

方法

AddValidation(ClientModelValidationContext)

AttributeAdapterBase<TAttribute>(对于 RequiredAttribute)。

GetErrorMessage(ModelMetadata, Object[])

获取使用 格式化的 Attribute错误消息。

(继承自 ValidationAttributeAdapter<TAttribute>)
GetErrorMessage(ModelValidationContextBase)

获取错误消息。

适用于