ValidationAttributeAdapterProvider.GetAttributeAdapter Method

Definition

Creates an IAttributeAdapter for the given attribute.

C#
public Microsoft.AspNetCore.Mvc.DataAnnotations.IAttributeAdapter GetAttributeAdapter (System.ComponentModel.DataAnnotations.ValidationAttribute attribute, Microsoft.Extensions.Localization.IStringLocalizer stringLocalizer);
C#
public Microsoft.AspNetCore.Mvc.DataAnnotations.IAttributeAdapter? GetAttributeAdapter (System.ComponentModel.DataAnnotations.ValidationAttribute attribute, Microsoft.Extensions.Localization.IStringLocalizer? stringLocalizer);

Parameters

attribute
ValidationAttribute

The attribute to create an adapter for.

stringLocalizer
IStringLocalizer

The localizer to provide to the adapter.

Returns

An IAttributeAdapter for the given attribute.

Implements

Applies to

Produk Versi
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0