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
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
trueif model is valid, false otherwise.