NHibernate Validator using Fluent Interface

Apr 22, 2009 at 10:26 PM
Hello,

I am using NHibernate Validator using Fluent Interface:
http://fabiomaulo.blogspot.com/2009/02/diving-in-nhibernatevalidator.html
http://nhforge.org/blogs/nhibernate/archive/2009/02/18/nhibernate-validator-fluent-interface-configuration.aspx

Can I use XVal with NHibernate Validator Fluent Interface instead of using NHibernate Class Properties Annotations?

If not, will it be possible in the future?

I also found a way to use NHibernate with MVC:
http://nhforge.org/blogs/nhibernate/archive/2009/04/02/nhibernate-validator-and-asp-net-mvc.aspx

But I would like to use xVal to be able to have client validation to.

Thanks,
Miguel


Coordinator
Apr 23, 2009 at 8:36 AM
Edited Apr 23, 2009 at 8:37 AM
Miguel

> Can I use XVal with NHibernate Validator Fluent Interface instead of using NHibernate Class Properties Annotations?
I'm not sure - I haven't tried it. Based on how the NHibernateValidatorRulesProvider works (it reads the config *after* the attributes/xml has been interpreted by NHibernate Validator), it should be possible, but you'll have to try it. Let me know how you get on. Do you have to work around any issues to make it work, or does it just work first time?

> I also found a way to use NHibernate with MVC
Good, that deals with running the rules on the server. You can definitely combine that with xVal to give you client-side validation too.

Steve