Try our conversational search powered by Generative AI!

Class ContentDataAnnotationsValidator

Unsupported INTERNAL API! Not covered by semantic versioning; might change without notice. 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.Internal
Assembly: EPiServer.dll
Version: 11.20.7
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)

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

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

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