DataAnnotationsModelValidator Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides a model validator.
public class DataAnnotationsModelValidator : System.Web.Mvc.ModelValidator
type DataAnnotationsModelValidator = class
inherit ModelValidator
Public Class DataAnnotationsModelValidator
Inherits ModelValidator
- Inheritance
- Derived
Constructors
| DataAnnotationsModelValidator(ModelMetadata, ControllerContext, ValidationAttribute) |
Initializes a new instance of the DataAnnotationsModelValidator class. |
Properties
| Attribute |
Gets the validation attribute for the model validator. |
| ControllerContext |
Gets the controller context. (Inherited from ModelValidator) |
| ErrorMessage |
Gets the error message for the validation failure. |
| IsRequired |
Gets a value that indicates whether model validation is required. |
| Metadata |
Gets the metadata for the model validator. (Inherited from ModelValidator) |
Methods
| GetClientValidationRules() |
Retrieves a collection of client validation rules. |
| Validate(Object) |
Returns a list of validation error messages for the model. |