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

 

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

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 As Object,
    type As Type,
    metadataProvider As ModelMetadataProvider,
    actionContext As HttpActionContext,
    keyPrefix As String
) As Boolean

Parameters

Return Value

Type: System.Boolean

trueif model is valid, false otherwise.

See Also

IBodyModelValidator Interface
System.Web.Http.Validation Namespace

Return to top