SaaS CMS has officially launched! Learn more now.

Class PropertyValidatorBase<TSettings>

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Base class for property validators validating a property against a certain IPropertyValidationSettings.

Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.Validation.Internal
Assembly: EPiServer.dll
Version: 11.20.7
Syntax
public abstract class PropertyValidatorBase<TSettings> : IValidate<IContentData>, IValidate where TSettings : IPropertyValidationSettings
Type Parameters
Name Description
TSettings

The type of IPropertyValidationSettings that describes the validation.

Constructors

PropertyValidatorBase(IPropertyDefinitionRepository, IPropertyValidationSettingsRepository)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. Initializes the PropertyValidatorBase<TSettings> base class.

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

Methods

CanHandle(PropertyData)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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)

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice.

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

Implements

Extension Methods