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
objectThe model to be validated.
type
TypeThe Type to use for validation.
metadataProvider
ModelMetadataProviderThe ModelMetadataProvider used to provide the model metadata.
actionContext
HttpActionContextThe HttpActionContext within which the model is being validated.
keyPrefix
stringThe string to append to the key for any validation errors.
Returns
- bool
True if model is valid, false otherwise.