Dario Quintana

at blogging

NHibernate Validator 1.3.2 GA

The last version of NHibernate Validator was published. You may find the here:

Source or Binaries

As you may notice, the sources are not longer at Sourceforge SVN, were moved to GitHub. For practical reasons the binaries still being published at Sourceforge.

  • Rick Moroz

    I am trying to upgrade from 1.0.0 to 1.3.2. We are programmatically configuring the validator engine. The code we had for 1.0.0 will not compile against 1.3.2. In particular, we had been using NHVConfiguration which no longer exists. Is there a replacement class for that with the same support? We were setting validator mode to ValidatorMode.OverrideAttributeWithXml, and adding MappingConfiguration’s.

    Here is a portion of our code using 1.0.0:    NHVConfiguration configOptions = new NHVConfiguration();    configOptions.Properties[NHibernate.Validator.Cfg.Environment.ValidatorMode] = ValidatorMode.OverrideAttributeWithXml.ToString();    MappingConfiguration mapping = new MappingConfiguration(path);    configOptions.Mappings.Add(mapping);    _validatorEngine = new ValidatorEngine();    _validatorEngine.Configure(configOptions);

  • Rick Moroz

    After some digging, I found out how to do the equivalent with 1.3.2 as follows:

    var configOptions = new FluentConfiguration();
    configOptions.SetDefaultValidatorMode(ValidatorMode.OverrideAttributeWithExternal);
    XmlMappingLoader mappingLoader = new XmlMappingLoader();
    mappingLoader.AddFile(path);
    _validatorEngine = new ValidatorEngine();
    _validatorEngine.Configure(configOptions, mappingLoader);