ModelValidator ModelValidator ModelValidator Class

Definition

Provides a base class for implementing validation logic.

public abstract class ModelValidator
type ModelValidator = class
Public MustInherit Class ModelValidator
Inheritance
ModelValidatorModelValidatorModelValidator
Derived

Constructors

ModelValidator(ModelMetadata, ControllerContext) ModelValidator(ModelMetadata, ControllerContext) ModelValidator(ModelMetadata, ControllerContext)

Called from constructors in derived classes to initialize the ModelValidator class.

Properties

ControllerContext ControllerContext ControllerContext

Gets the controller context.

IsRequired IsRequired IsRequired

Gets or sets a value that indicates whether a model property is required.

Metadata Metadata Metadata

Gets the metadata for the model validator.

Methods

GetClientValidationRules() GetClientValidationRules() GetClientValidationRules()

When implemented in a derived class, returns metadata for client validation.

GetModelValidator(ModelMetadata, ControllerContext) GetModelValidator(ModelMetadata, ControllerContext) GetModelValidator(ModelMetadata, ControllerContext)

Returns a composite model validator for the model.

Validate(Object) Validate(Object) Validate(Object)

When implemented in a derived class, validates the object.

Applies to