Class PasswordValidationRule
Validation rule designed for PasswordComponent.
public sealed class PasswordValidationRule : ValidationRule<string>, IValidationRule
- Inheritance
-
objectValidationRule<string>PasswordValidationRule
- Implements
- Inherited Members
- Extension Methods
Constructors
PasswordValidationRule(ILocalizationService, PasswordProperties)
Initializes a new instance of PasswordValidationRule.
public PasswordValidationRule(ILocalizationService localizationService, PasswordProperties properties)
Parameters
localizationService
ILocalizationServiceproperties
PasswordProperties
Properties
DefaultErrorMessage
Defines default error message of the validation rule.
protected override string DefaultErrorMessage { get; }
Property Value
- string
Methods
Validate(string, IFormFieldValueProvider)
Validates value
and returns the validation result.
public override Task<ValidationResult> Validate(string value, IFormFieldValueProvider formFieldValueProvider)
Parameters
value
stringValue to be validated.
formFieldValueProvider
IFormFieldValueProviderProvider of values of other form fields for contextual validation.
Returns
- Task<ValidationResult>
Returns validation result with IsValid set to true, if value is valid. Otherwise returns result with the flag set to false and a corresponding error message.