IBodyModelValidator.Validate Method

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

Return Value

Type: System.Boolean
true if model is valid, false otherwise.

See Also

Reference

IBodyModelValidator Interface

System.Web.Http.Validation Namespace