Validation Block vs Nhibernate.Validator

model, nhibernate, validation

Solution

NHibernate Validator does not require you to use NHibernate for persistence. Usage can be as simple as:

var engine = new ValidatorEngine();
InvalidValue[] errors = engine.Validate(someModelObjectWithAttributes);

foreach(var error in errors)
{
    Console.WriteLine(error.Message);
}

Of course it can hook into NHibernate and prevent persistence of invalid objects, but you may use it to validate non-persistent objects as well.

Problem

I am looking for validation framework and while I am already using NHibernate I am thinking of using NHibernate.validator from contrib project however I also look at MS Validation Block which seem to be robust but i am not yet get into detail of each one yet so I wonder has anyone had step into these two frameworks and how is the experience like?

Original source