DefaultBodyModelValidator.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
Public Function Validate ( _
    model As Object, _
    type As Type, _
    metadataProvider As ModelMetadataProvider, _
    actionContext As HttpActionContext, _
    keyPrefix As String _
) As Boolean
'Usage
Dim instance As DefaultBodyModelValidator 
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)
public bool Validate(
    Object model,
    Type type,
    ModelMetadataProvider metadataProvider,
    HttpActionContext actionContext,
    string keyPrefix
)
public:
virtual bool Validate(
    Object^ model, 
    Type^ type, 
    ModelMetadataProvider^ metadataProvider, 
    HttpActionContext^ actionContext, 
    String^ keyPrefix
) sealed
abstract Validate : 
        model:Object * 
        type:Type * 
        metadataProvider:ModelMetadataProvider * 
        actionContext:HttpActionContext * 
        keyPrefix:string -> bool  
override Validate : 
        model:Object * 
        type:Type * 
        metadataProvider:ModelMetadataProvider * 
        actionContext:HttpActionContext * 
        keyPrefix:string -> bool
public final 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.

Implements

IBodyModelValidator.Validate(Object, Type, ModelMetadataProvider, HttpActionContext, String)

See Also

Reference

DefaultBodyModelValidator Class

System.Web.Http.Validation Namespace