C# Class System.Data.Entity.Internal.Validation.ValidationAttributeValidator

Validates a property, complex property or an entity using validation attributes the property or the complex/entity type is decorated with.
Note that this class is used for validating primitive properties using attributes declared on the property (property level validation) and complex properties and entities using attributes declared on the type (type level validation).
Inheritance: IValidator
Mostra file Open project: aspnet/EntityFramework6 Class Usage Examples

Public Methods

Method Description
Validate ( System.Data.Entity.Internal.Validation.EntityValidationContext entityValidationContext, InternalMemberEntry property ) : IEnumerable

Validates a property or an entity.

ValidationAttributeValidator ( System.ComponentModel.DataAnnotations.ValidationAttribute validationAttribute, System.ComponentModel.DataAnnotations.DisplayAttribute displayAttribute ) : System.Collections.Generic

Creates an instance of ValidationAttributeValidator class.

Protected Methods

Method Description
AttributeApplicable ( System.Data.Entity.Internal.Validation.EntityValidationContext entityValidationContext, InternalMemberEntry property ) : bool

Determines if the attribute should be enforced given the context of the validation request.

Method Details

AttributeApplicable() protected method

Determines if the attribute should be enforced given the context of the validation request.
protected AttributeApplicable ( System.Data.Entity.Internal.Validation.EntityValidationContext entityValidationContext, InternalMemberEntry property ) : bool
entityValidationContext System.Data.Entity.Internal.Validation.EntityValidationContext Validation context. Never null.
property InternalMemberEntry Property to validate. Null for entity validation. Not null for property validation.
return bool

Validate() public method

Validates a property or an entity.
public Validate ( System.Data.Entity.Internal.Validation.EntityValidationContext entityValidationContext, InternalMemberEntry property ) : IEnumerable
entityValidationContext System.Data.Entity.Internal.Validation.EntityValidationContext Validation context. Never null.
property InternalMemberEntry Property to validate. Null for entity validation. Not null for property validation.
return IEnumerable

ValidationAttributeValidator() public method

Creates an instance of ValidationAttributeValidator class.
public ValidationAttributeValidator ( System.ComponentModel.DataAnnotations.ValidationAttribute validationAttribute, System.ComponentModel.DataAnnotations.DisplayAttribute displayAttribute ) : System.Collections.Generic
validationAttribute System.ComponentModel.DataAnnotations.ValidationAttribute Validation attribute used to validate a property or an entity.
displayAttribute System.ComponentModel.DataAnnotations.DisplayAttribute
return System.Collections.Generic