IValidationAttributeAdapterProvider.GetAttributeAdapter 方法

定义

返回 IAttributeAdapter 给定 ValidationAttribute的 的 。

public:
 Microsoft::AspNetCore::Mvc::DataAnnotations::IAttributeAdapter ^ GetAttributeAdapter(System::ComponentModel::DataAnnotations::ValidationAttribute ^ attribute, Microsoft::Extensions::Localization::IStringLocalizer ^ stringLocalizer);
public Microsoft.AspNetCore.Mvc.DataAnnotations.IAttributeAdapter GetAttributeAdapter (System.ComponentModel.DataAnnotations.ValidationAttribute attribute, Microsoft.Extensions.Localization.IStringLocalizer stringLocalizer);
public Microsoft.AspNetCore.Mvc.DataAnnotations.IAttributeAdapter? GetAttributeAdapter (System.ComponentModel.DataAnnotations.ValidationAttribute attribute, Microsoft.Extensions.Localization.IStringLocalizer? stringLocalizer);
abstract member GetAttributeAdapter : System.ComponentModel.DataAnnotations.ValidationAttribute * Microsoft.Extensions.Localization.IStringLocalizer -> Microsoft.AspNetCore.Mvc.DataAnnotations.IAttributeAdapter
Public Function GetAttributeAdapter (attribute As ValidationAttribute, stringLocalizer As IStringLocalizer) As IAttributeAdapter

参数

attribute
ValidationAttribute

ValidationAttribute要为其创建 的 IAttributeAdapter

stringLocalizer
IStringLocalizer

IStringLocalizer 用于创建消息的 。

返回

给定IAttributeAdapterattribute的 的 。

适用于