ValidationAttributeFormatterRegistry.GetFormatter(ValidationAttribute) Methode

Definitie

Retourneert een IValidationAttributeFormatter voor de opgegeven attribute. Als het kenmerk zichzelf implementeert IValidationAttributeFormatter , wordt het rechtstreeks geretourneerd. Anders wordt het register geraadpleegd. Retourneert null als er geen notatie is geregistreerd voor het type van het kenmerk.

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

Het validatiekenmerk voor het ophalen van een opmaakprogramma.

Retouren

Een IValidationAttributeFormatter als het kenmerk zelfindelingen of een fabriek is geregistreerd; anders. null

Van toepassing op