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
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
Assembly: EPiServer.dll
Version: 9.12.2
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()

Initializes a new instance of the ContentDataAnnotationsValidator class.

Declaration
[Obsolete("Use alternative constructor")]
public ContentDataAnnotationsValidator()

ContentDataAnnotationsValidator(LocalizationService)

Initializes a new instance of the ContentDataAnnotationsValidator class.

Declaration
[Obsolete("Use alternative constructor")]
public ContentDataAnnotationsValidator(LocalizationService localizationService)
Parameters
Type Name Description
LocalizationService localizationService

The localization service.

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