Class EmailValidationRule
Validates whether field value is a valid email address.
[ValidationRuleAttribute(typeof(EmailValidationRuleAttribute))]
public sealed class EmailValidationRule : ValidationRule<EmailValidationRuleProperties, EmailValidationRuleClientProperties, string>, IValidationRule
- Inheritance
-
objectEmailValidationRule
- Implements
- Inherited Members
- Extension Methods
Constructors
EmailValidationRule(ILocalizationService)
Creates a new instance of EmailValidationRule class.
public EmailValidationRule(ILocalizationService localizationService)
Parameters
localizationService
ILocalizationService
Properties
ClientRuleName
Gets the client rule name identifier.
public override string ClientRuleName { get; }
Property Value
- string
DefaultErrorMessage
Defines default error message of the validation rule.
protected override string DefaultErrorMessage { get; }
Property Value
- string
Methods
ConfigureClientProperties(EmailValidationRuleClientProperties)
Allows set validation rule client properties.
protected override Task ConfigureClientProperties(EmailValidationRuleClientProperties clientProperties)
Parameters
clientProperties
EmailValidationRuleClientPropertiesCurrent instance of client properties.
Returns
- Task
Validate(string, IFormFieldValueProvider)
Validates whether value
is a valid email address.
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 the validation result.