Skip to content

ValidationRuleMessage.Failure method

Gets the result for an attribute whose value is not valid, with its message, see Format, for the member being validated.

public static ValidationResult Failure(ValidationAttribute attribute, ValidationContext? context, 
    string defaultKey, params object?[] args)
parameter description
attribute The attribute.
context The context, whose localizer is used, see GetLocalizer, and the text key of whose property the implied text key of the message starts with, see PropertyTextKeyItem.
defaultKey The local text key of the default message of the rule.
args The parameters of the rule.

See Also