共用方式為


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 建立訊息的 。

傳回

IAttributeAdapter指定 attribute 之 的 。

適用於