November Happy Hour will be moved to Thursday December 5th.

Class PropertyValidatorBase<TSettings>

Base class for property validators validating a property against a certain IPropertyValidationSettings.

Namespace: EPiServer.Validation.Internal
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
public abstract class PropertyValidatorBase<TSettings> : Object, IValidate<IContentData>, IValidate where TSettings : IPropertyValidationSettings
Type Parameters
Name Description
TSettings

The type of IPropertyValidationSettings that describes the validation.

Constructors

PropertyValidatorBase(IPropertyDefinitionRepository, IPropertyValidationSettingsRepository)

Initializes the PropertyValidatorBase<TSettings> base class.

Declaration
protected PropertyValidatorBase(IPropertyDefinitionRepository propertyDefinitionRepository, IPropertyValidationSettingsRepository validationSettingsRepository)
Parameters
Type Name Description
IPropertyDefinitionRepository propertyDefinitionRepository
IPropertyValidationSettingsRepository validationSettingsRepository

Methods

CanHandle(PropertyData)

Checks if the validator applies to this property.

Declaration
protected abstract bool CanHandle(PropertyData property)
Parameters
Type Name Description
PropertyData property
Returns
Type Description
System.Boolean

ErrorMessage(PropertyDefinition, PropertyData, TSettings)

Returns an error message that describes the validation error.

Declaration
protected abstract string ErrorMessage(PropertyDefinition propertyDefinition, PropertyData property, TSettings settings)
Parameters
Type Name Description
PropertyDefinition propertyDefinition
PropertyData property
TSettings settings
Returns
Type Description
System.String

IsValid(PropertyData, TSettings)

Checks if the property is valid according to the provided settings.

Declaration
protected abstract bool IsValid(PropertyData property, TSettings settings)
Parameters
Type Name Description
PropertyData property
TSettings settings
Returns
Type Description
System.Boolean

Validate(IContentData)

Declaration
public IEnumerable<ValidationError> Validate(IContentData instance)
Parameters
Type Name Description
IContentData instance
Returns
Type Description
System.Collections.Generic.IEnumerable<ValidationError>

Implements

Extension Methods