ValidationVisitor ValidationVisitor ValidationVisitor Class

Definition

A visitor implementation that interprets ValidationStateDictionary to traverse a model object graph and perform validation.

public class ValidationVisitor
type ValidationVisitor = class
Public Class ValidationVisitor
Inheritance
ValidationVisitorValidationVisitorValidationVisitor

Constructors

ValidationVisitor(ActionContext, IModelValidatorProvider, ValidatorCache, IModelMetadataProvider, ValidationStateDictionary) ValidationVisitor(ActionContext, IModelValidatorProvider, ValidatorCache, IModelMetadataProvider, ValidationStateDictionary) ValidationVisitor(ActionContext, IModelValidatorProvider, ValidatorCache, IModelMetadataProvider, ValidationStateDictionary)

Creates a new ValidationVisitor.

Properties

AllowShortCircuitingValidationWhenNoValidatorsArePresent AllowShortCircuitingValidationWhenNoValidatorsArePresent AllowShortCircuitingValidationWhenNoValidatorsArePresent

Gets or sets a value that determines if ValidationVisitor can short circuit validation when a model does not have any associated validators.

Cache Cache Cache
Container Container Container
Context Context Context
CurrentPath CurrentPath CurrentPath
Key Key Key
MaxValidationDepth MaxValidationDepth MaxValidationDepth

Gets or sets the maximum depth to constrain the validation visitor when validating.

ValidationVisitor traverses the object graph of the model being validated. For models that are very deep or are infinitely recursive, validation may result in stack overflow.

When not null, Visit(ModelMetadata, String, Object) will throw if current traversal depth exceeds the specified value.

Metadata Metadata Metadata
MetadataProvider MetadataProvider MetadataProvider
Model Model Model
ModelState ModelState ModelState
Strategy Strategy Strategy
ValidateComplexTypesIfChildValidationFails ValidateComplexTypesIfChildValidationFails ValidateComplexTypesIfChildValidationFails

Indicates whether validation of a complex type should be performed if validation fails for any of its children. The default behavior is false.

ValidationState ValidationState ValidationState
ValidatorProvider ValidatorProvider ValidatorProvider

Methods

GetValidationEntry(Object) GetValidationEntry(Object) GetValidationEntry(Object)
SuppressValidation(String) SuppressValidation(String) SuppressValidation(String)
Validate(ModelMetadata, String, Object) Validate(ModelMetadata, String, Object) Validate(ModelMetadata, String, Object)

Validates a object.

Validate(ModelMetadata, String, Object, Boolean) Validate(ModelMetadata, String, Object, Boolean) Validate(ModelMetadata, String, Object, Boolean)

Validates a object.

ValidateNode() ValidateNode() ValidateNode()

Validates a single node in a model object graph.

Visit(ModelMetadata, String, Object) Visit(ModelMetadata, String, Object) Visit(ModelMetadata, String, Object)
VisitChildren(IValidationStrategy) VisitChildren(IValidationStrategy) VisitChildren(IValidationStrategy)
VisitComplexType(IValidationStrategy) VisitComplexType(IValidationStrategy) VisitComplexType(IValidationStrategy)
VisitSimpleType() VisitSimpleType() VisitSimpleType()

Applies to