I can't find any details on this, but the issue I am having is that Validate function of parent object doesn't get called if Validate call fails on any child properties. Simple scenario below:
public class Child : IValidateObject
{
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{ ... }
}
public class Parent : IValidatableObject
{
public Child Child { get; set;}
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext)
{ ... }
}
If the validation in the child fails then the Validate function of the parent doesn't get called so you end up having to fix all the child issues first then submit and only then will you see all the validation failures of the parent.
If someone can either help me understand why this is happening or point me to some documents regarding this that would be awesome.