Share via


ModelValidator Class

Definition

Provides a base class for implementing validation logic.

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

Constructors

ModelValidator(ModelMetadata, ControllerContext)

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

Properties

ControllerContext

Gets the controller context.

IsRequired

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

Metadata

Gets the metadata for the model validator.

Methods

GetClientValidationRules()

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

GetModelValidator(ModelMetadata, ControllerContext)

Returns a composite model validator for the model.

Validate(Object)

When implemented in a derived class, validates the object.

Applies to