ValidationAttributeFormatterRegistry.GetFormatter(ValidationAttribute) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Returns an IValidationAttributeFormatter for the specified attribute.
If the attribute implements IValidationAttributeFormatter itself, it is returned directly.
Otherwise, the registry is consulted. Returns null if no formatter is registered
for the attribute's type.
public:
Microsoft::Extensions::Validation::Localization::IValidationAttributeFormatter ^ GetFormatter(System::ComponentModel::DataAnnotations::ValidationAttribute ^ attribute);
public Microsoft.Extensions.Validation.Localization.IValidationAttributeFormatter? GetFormatter(System.ComponentModel.DataAnnotations.ValidationAttribute attribute);
member this.GetFormatter : System.ComponentModel.DataAnnotations.ValidationAttribute -> Microsoft.Extensions.Validation.Localization.IValidationAttributeFormatter
Public Function GetFormatter (attribute As ValidationAttribute) As IValidationAttributeFormatter
Parameters
- attribute
- ValidationAttribute
The validation attribute to get a formatter for.
Returns
An IValidationAttributeFormatter if the attribute self-formats or a factory
is registered; otherwise, null.