IValidationLocalizer.ResolveErrorMessage Method

Definition

Resolves a fully-formatted localized error message for the validation attribute described by context.

public:
 System::String ^ ResolveErrorMessage(Microsoft::Extensions::Validation::ErrorMessageLocalizationContext ^ context);
public string? ResolveErrorMessage(in Microsoft.Extensions.Validation.ErrorMessageLocalizationContext? context);
abstract member ResolveErrorMessage : ErrorMessageLocalizationContext -> string
Public Function ResolveErrorMessage (context As ErrorMessageLocalizationContext) As String

Parameters

context
ErrorMessageLocalizationContext

Information about the validation attribute and the member it applied to.

Returns

The fully-formatted localized error message, or null to use the attribute's default message.

Remarks

Implementations should return null when no localized message is available; the validation pipeline falls back to the attribute's default error message.

Applies to