Table of Contents

Class EmailValidationRule

Namespace
Kentico.Xperience.Admin.Base.Forms
Assembly
Kentico.Xperience.Admin.Base.dll

Validates whether field value is a valid email address.

[ValidationRuleAttribute(typeof(EmailValidationRuleAttribute))]
public sealed class EmailValidationRule : ValidationRule<EmailValidationRuleProperties, EmailValidationRuleClientProperties, string>, IValidationRule
Inheritance
object
EmailValidationRule
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 EmailValidationRuleClientProperties

Current 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 string

Value to be validated.

formFieldValueProvider IFormFieldValueProvider

Provider of values of other form fields for contextual validation.

Returns

Task<ValidationResult>

Returns the validation result.