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
modelobjectThe model to be validated.
typeTypeThe Type to use for validation.
metadataProviderModelMetadataProviderThe ModelMetadataProvider used to provide the model metadata.
actionContextHttpActionContextThe HttpActionContext within which the model is being validated.
keyPrefixstringThe string to append to the key for any validation errors.
Returns
- bool
trueif model is valid, false otherwise.