Determines whether the model is valid and adds any validation errors to the actionContext's ModelStateDictionary
Namespace:  System.Web.Http.Validation
Assembly:  System.Web.Http (in System.Web.Http.dll)
Syntax
'Declaration
Function Validate ( _
    model As Object, _
    type As Type, _
    metadataProvider As ModelMetadataProvider, _
    actionContext As HttpActionContext, _
    keyPrefix As String _
) As Boolean
'Usage
Dim instance As IBodyModelValidator 
Dim model As Object 
Dim type As Type 
Dim metadataProvider As ModelMetadataProvider 
Dim actionContext As HttpActionContext 
Dim keyPrefix As String 
Dim returnValue As Boolean 
returnValue = instance.Validate(model, _
    type, metadataProvider, actionContext, _
    keyPrefix)
bool Validate(
    Object model,
    Type type,
    ModelMetadataProvider metadataProvider,
    HttpActionContext actionContext,
    string keyPrefix
)
bool Validate(
    Object^ model, 
    Type^ type, 
    ModelMetadataProvider^ metadataProvider, 
    HttpActionContext^ actionContext, 
    String^ keyPrefix
)
abstract Validate : 
        model:Object * 
        type:Type * 
        metadataProvider:ModelMetadataProvider * 
        actionContext:HttpActionContext * 
        keyPrefix:string -> bool
function Validate(
    model : Object, 
    type : Type, 
    metadataProvider : ModelMetadataProvider, 
    actionContext : HttpActionContext, 
    keyPrefix : String
) : boolean
Parameters
- model 
 Type: System.Object- The model to be validated. 
- type 
 Type: System.Type- The Type to use for validation. 
- metadataProvider 
 Type: System.Web.Http.Metadata.ModelMetadataProvider- The ModelMetadataProvider used to provide the model metadata. 
- actionContext 
 Type: System.Web.Http.Controllers.HttpActionContext- The HttpActionContext within which the model is being validated. 
- keyPrefix 
 Type: System.String- The String to append to the key for any validation errors. 
Return Value
Type: System.Boolean
true if model is valid, false otherwise.