ValidationOptions.MessageKeyProvider Property

Definition

Gets or sets a delegate that computes the resource key used to look up a localized validation message.

public:
 property Func<Microsoft::Extensions::Validation::ValidationMessageKeyContext ^, System::String ^> ^ MessageKeyProvider { Func<Microsoft::Extensions::Validation::ValidationMessageKeyContext ^, System::String ^> ^ get(); void set(Func<Microsoft::Extensions::Validation::ValidationMessageKeyContext ^, System::String ^> ^ value); };
public Func<Microsoft.Extensions.Validation.ValidationMessageKeyContext,string?>? MessageKeyProvider { get; set; }
member this.MessageKeyProvider : Func<Microsoft.Extensions.Validation.ValidationMessageKeyContext, string> with get, set
Public Property MessageKeyProvider As Func(Of ValidationMessageKeyContext, String)

Property Value

Remarks

The provider supplies the lookup key by convention (for example, keyed by ValidatorType) for validators that do not specify an explicit message. When a validator specifies an explicit message, that message is used as the lookup key and the provider is not consulted.

Applies to