ValidationVisitor Class

Definition

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

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

Constructors

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

Creates a new ValidationVisitor.

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

Creates a new ValidationVisitor.

Properties

AllowShortCircuitingValidationWhenNoValidatorsArePresent

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

Cache
Container
Context
CurrentPath
Key
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
MetadataProvider
Model
ModelState
Strategy
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
ValidatorProvider

Methods

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

Validates a object.

Validate(ModelMetadata, String, Object, Boolean)

Validates a object.

ValidateNode()

Validates a single node in a model object graph.

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

Applies to