Table of Contents

Class DefaultBodyModelValidator

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

Represents a class used to recursively validate an object.

public class DefaultBodyModelValidator : IBodyModelValidator
Inheritance
DefaultBodyModelValidator
Implements
Inherited Members

Constructors

DefaultBodyModelValidator()

Initializes a new instance of the DefaultBodyModelValidator class.

public DefaultBodyModelValidator()

Methods

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

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

public 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

True if model is valid, false otherwise.