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)

bool Validate(
	object model,
	Type type,
	ModelMetadataProvider metadataProvider,
	HttpActionContext actionContext,
	string keyPrefix
)

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

trueif model is valid, false otherwise.

Return to top
Show: