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
Afficher le fichier Open project: aspnet/EntityFramework6 Class Usage Examples

Méthodes publiques

Méthode 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.

Méthodes protégées

Méthode 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 méthode

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.
Résultat bool

Validate() public méthode

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.
Résultat IEnumerable

ValidationAttributeValidator() public méthode

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
Résultat System.Collections.Generic