Delen via


Microsoft.AspNetCore.Mvc.ModelBinding.Validation Namespace

Provides types used to perform model validation.

Classes

ClientModelValidationContext

The context for client-side model validation.

ClientValidatorCache

Cache for IClientModelValidators.

ClientValidatorItem

Used to associate validators with ValidatorMetadata instances as part of ClientValidatorProviderContext. An IClientModelValidator should inspect Results and set Validator and IsReusable as appropriate.

ClientValidatorProviderContext

A context for IClientModelValidatorProvider.

CompositeClientModelValidatorProvider

Aggregate of IClientModelValidatorProviders that delegates to its underlying providers.

CompositeModelValidatorProvider

Aggregate of IModelValidatorProviders that delegates to its underlying providers.

ModelValidationContext

A context object for IModelValidator.

ModelValidationContextBase

A common base class for ModelValidationContext and ClientModelValidationContext.

ModelValidationResult

The result of model validation.

ModelValidatorProviderContext

A context for IModelValidatorProvider.

ModelValidatorProviderExtensions

Extension methods for IModelValidatorProvider.

ValidateNeverAttribute

Indicates that a property or parameter should be excluded from validation. When applied to a property, the validation system excludes that property. When applied to a parameter, the validation system excludes that parameter. When applied to a type, the validation system excludes all properties within that type.

ValidationStateDictionary

Used for tracking validation state to customize validation behavior for a model object.

ValidationStateEntry

An entry in a ValidationStateDictionary. Records state information to override the default behavior of validation for an object.

ValidationVisitor

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

ValidatorCache

A cache for IModelValidator

ValidatorItem

Used to associate validators with ValidatorMetadata instances as part of ModelValidatorProviderContext. An IModelValidator should inspect Results and set Validator and IsReusable as appropriate.

Structs

ValidationEntry

Contains data needed for validating a child entry of a model object. See IValidationStrategy.

ValidationVisitor.StateManager

State manager used for by ValidationVisitor.

Interfaces

IClientModelValidator

Specifies the contract for performing validation in the browser.

MVC's validation system invokes IClientModelValidator to gather attributes that apply to the rendered HTML. The rendered view may have to reference JavaScript libraries, such as jQuery Unobtrusive Validation, to provide client validation based on the presence of these attributes.

IClientModelValidatorProvider

Provides a collection of IClientModelValidators.

IMetadataBasedModelValidatorProvider

An IModelValidatorProvider that provides IModelValidator instances exclusively using values in ValidatorMetadata or the model type.

IMetadataBasedModelValidatorProvider can be used to statically determine if a given ModelMetadata instance can incur any validation. The value for HasValidators can be calculated if all instances in ModelValidatorProviders are IMetadataBasedModelValidatorProvider.

IModelValidator

Validates a model value.

IModelValidatorProvider

Provides validators for a model value.

IObjectModelValidator

Provides methods to validate an object graph.

IPropertyValidationFilter

Contract for attributes that determine whether associated properties should be validated. When the attribute is applied to a property, the validation system calls ShouldValidateEntry(ValidationEntry, ValidationEntry) to determine whether to validate that property. When applied to a type, the validation system calls ShouldValidateEntry(ValidationEntry, ValidationEntry) for each property that type defines to determine whether to validate it.

IValidationStrategy

Defines a strategy for enumerating the child entries of a model object which should be validated.

Remarks

For an introduction to validation, Model validation.