I have a view model that implements IValidatableObject, and also has several validation attributes. When I try to invoke an action on my ApiController, only an attribute check is performed. Doesn't support ASP.NET API IValidatableObject? What is an alternative to complex validation that cannot be represented by a single attribute?
Edit: Somewhere along the line, I must have faked something. Validation mysteriously began to work as expected. It appears that IValidatableObject is definitely supported by default.
IValidatableObject webapi, , Validation DataAnnotations (DataAnnotationsModelValidatorProvider) IValidatableObject. . : http://msdn.microsoft.com/en-us/library/system.web.http.validation.providers(v = vs .108)
ValidationAttribute , ... , IValidatableObject, .
Web API 2.1 (Microsoft.AspNet.WebApi nuget 5.1.x) ValidalidableBlate Validate, , - . , , , , .
, , RequiredAttribute, , IValidatableObject Validate . , , Validate , .
RequiredAttribute
Currently supported IValidatableObject.