I played around with nhibernate validator and got a nearly perfect solution.
I can define a property to be validated and it's done on pre-save. But I have some cases where it's not working.
Let's assume I have an object called person and via nhibernate I mapped the address(also an object) to be a property of person (in fact it's a list of addresses).
When I save the person my address is not validated.
The form to enter the information is made out of partial forms. Would be nice if the address validation could be added to the person's validation list, but thats not required.
I need a general solution, I cannot validate by "hand" e.g. if person then validate address... Somehow the validator should see that there is an object behind the property which I also have to validate.
Update: What I am looking for is a way to validate mapped objects (hasmany).