Enterprise Library Validation Application Block validate object to relative object in hierarchy

191 Views Asked by At

I have a kind of hierarchycal class, meaning that it contains collections of user defined objects. I want to be able to apply validation at child level but referencing some properties in the parent level. Is there a way to do this with the build in validator in Validation Application Block? If not, I would really appriciate a generic example of such validator.

UPDATE

I thought giving a little example might help understanding the problem. So here it is:

public class Group
{
    public int ID {get;set;}
    public DateTime RegistrationDate {get;set;}    
    public List<Student> Students{ get; set; }
}

public class Student
{
    public string Name {get;set;}
    public string BirthDate{ get; set; }
    public int GroupId {get;set;}
}

Now my problem is that I want to compute the age of a person at the registration date in the group and validate it. This is only a trivial example as a have a little more complex scenarios than this. What is the best way to validate it?

0

There are 0 best solutions below