Table of Contents

Interface IBodyModelValidator

Namespace
System.Web.Http.Validation
Assembly
System.Web.Http.dll

Represents an interface for the validation of the models

public interface IBodyModelValidator

Methods

Validate(object, Type, ModelMetadataProvider, HttpActionContext, string)

Determines whether the model is valid and adds any validation errors to the actionContext's ModelStateDictionary

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

Parameters

model object

The model to be validated.

type Type

The Type to use for validation.

metadataProvider ModelMetadataProvider

The ModelMetadataProvider used to provide the model metadata.

actionContext HttpActionContext

The HttpActionContext within which the model is being validated.

keyPrefix string

The string to append to the key for any validation errors.

Returns

bool

trueif model is valid, false otherwise.