ModelValidator.GetModelValidator Method
Returns a composite model validator for the model.
Namespace: System.Web.Mvc
Assembly: System.Web.Mvc (in System.Web.Mvc.dll)
static member GetModelValidator : metadata:ModelMetadata * context:ControllerContext -> ModelValidator
Parameters
- metadata
- Type: System.Web.Mvc.ModelMetadata
The metadata.
- context
- Type: System.Web.Mvc.ControllerContext
The controller context.
The TryValidateModel method calls this method and runs all the validators for the model's properties. If no validators fail, the TryValidateModel method runs all the validators of the object itself (at the type level).
Show: