Somethiing like this var configuration = new Configuration(); var properties = MsSqlConfiguration.MsSql2005.ConnectionString.FromConnectionStringWithKey("DbString").ToProperties(); configuration.AddProperties(properties);
var nhvc = new NHVConfiguration(); nhvc.Properties[NHibernate.Validator.Cfg.Environment.ValidatorMode] = "UseAttribute"; nhvc.Mappings.Add(new NHibernate.Validator.Cfg.MappingConfiguration("Namespace I think if not assembly name", null)); validator = new ValidatorEngine(); validator.Configure(nhvc); ValidatorInitializer.Initialize(configuration, validator); AutoPersistenceModel .MapEntitiesFromAssemblyOf<NewsItem>() .Where(t => t.Namespace == "Wbl.Domain.Entities") .Configure(configuration); sessionFactory = configuration.BuildSessionFactory(); Hope that helps. Andy On Tue, Mar 10, 2009 at 2:26 PM, brendanjerwin <brendanjer...@gmail.com>wrote: > > I'm trying to integrate the NHibernate Validator into my domain > models. I've got it working by calling the ValidationEngine > explicitly. However, one of the other features the thing offers is to > integrate with NHibernate and automatically run validations on INSERTs > and UPDATEs. I'm not sure how to get that going in a project that uses > fluent-nhibernate since the Validator configuration expects to be > given an assembly containing the mapping xml. Any suggestions or > pointers? > > > -- ================= I-nnovate Software - Bespoke Software Development, uk wirral. http://www.i-nnovate.net Easy Project Managment Online http://www.task-mate.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Fluent NHibernate" group. To post to this group, send email to fluent-nhibernate@googlegroups.com To unsubscribe from this group, send email to fluent-nhibernate+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/fluent-nhibernate?hl=en -~----------~----~----~----~------~----~------~--~---