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
model
Type: System.ObjectThe model to be validated.
type
Type: System.TypeThe Type to use for validation.
metadataProvider
Type: System.Web.Http.Metadata.ModelMetadataProviderThe ModelMetadataProvider used to provide the model metadata.
actionContext
Type: System.Web.Http.Controllers.HttpActionContextThe HttpActionContext within which the model is being validated.
keyPrefix
Type: System.StringThe String to append to the key for any validation errors.
Return Value
Type: System.Boolean
trueif model is valid, false otherwise.
See Also
IBodyModelValidator Interface
System.Web.Http.Validation Namespace
Return to top