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

Class ContentDataAnnotationsValidator

Validates the IContentData instance against attributes inheriting System.ComponentModel.DataAnnotations.ValidationAttribute.

Inheritance
System.Object
ContentDataAnnotationsValidator
Namespace: EPiServer.Validation.Internal
Assembly: EPiServer.dll
Version: 12.0.3
Syntax
[ServiceConfiguration]
public class ContentDataAnnotationsValidator : DataAnnotationsValidator<IContentData>, IValidate<IContentData>, IValidate
Remarks

Validation will not be performed against System.ComponentModel.DataAnnotations.RequiredAttribute since that is done through RequiredPropertyValidator

Constructors

ContentDataAnnotationsValidator(LocalizationService, IContentTypeRepository)

Initializes a new instance of the ContentDataAnnotationsValidator class.

Declaration
public ContentDataAnnotationsValidator(LocalizationService localizationService, IContentTypeRepository contentTypeRepository)
Parameters
Type Name Description
LocalizationService localizationService

The localization service.

IContentTypeRepository contentTypeRepository

The content type repository

Properties

IgnoredAttributes

Gets the ignored attributes.

Declaration
public override IEnumerable<Type> IgnoredAttributes { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Type>

The ignored attributes.

Overrides
EPiServer.Validation.DataAnnotationsValidator<EPiServer.Core.IContentData>.IgnoredAttributes
Remarks

Returns System.ComponentModel.DataAnnotations.RequiredAttribute

Methods

GetDisplayName(PropertyDescriptor, Object)

Gets the display name for the propertyDescriptor on the content type of the instance.

Declaration
protected override string GetDisplayName(PropertyDescriptor propertyDescriptor, object instance)
Parameters
Type Name Description
System.ComponentModel.PropertyDescriptor propertyDescriptor

The property to get the display name for.

System.Object instance

The object instance that propertyDescriptor is defined on.

Returns
Type Description
System.String

A translated display name if any translation exists.

Overrides
EPiServer.Validation.DataAnnotationsValidator<EPiServer.Core.IContentData>.GetDisplayName(System.ComponentModel.PropertyDescriptor, System.Object)

Implements

Extension Methods