Class ContentDataAnnotationsValidator
Validates the IContentData instance against attributes inheriting System.ComponentModel.DataAnnotations.ValidationAttribute.
Inherited Members
Namespace: EPiServer.Validation
Assembly: EPiServer.dll
Version: 9.12.2Syntax
[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
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 |
Returns
Type | Description |
---|---|
System.String | A translated display name if any translation exists. |