我正在尝试使用Fluent配置Nhibernate Validator但我收到错误。如果你们都能提供帮助,请谅解。
public void ConfigureNhibernateValidator(Configuration c)
var nhvConfiguration = new NHibernate.Validator.Cfg.Loquacious.FluentConfiguration();
nhvConfiguration
.SetDefaultValidatorMode(ValidatorMode.UseExternal)
.Register(Assembly.Load("namespace")
.ValidationDefinitions())
.IntegrateWithNHibernate
.ApplyingDDLConstraints()
.And
.RegisteringListeners();
var validatorEngine = new ValidatorEngine();
validatorEngine.Configure(nhvConfiguration);
c.Initialize(validatorEngine);
new SchemaExport(c).Execute(true, true, false);
此节目
Error 1 The name 'Assembly' does not exist in the current context.
我也试过
var nhvConfig = new NHibernate.Validator.Cfg.Loquacious.FluentConfiguration();
nhvConfig
.SetDefaultValidatorMode(ValidatorMode.UseExternal)
.Register(typeof(DealerManager)
.Assembly.ValidationDefinitions())
.IntegrateWithNHibernate
.ApplyingDDLConstraints().And.RegisteringListeners();
var validatorEngine = new ValidatorEngine();
validatorEngine.Configure(nhvConfig);
c.Initialize(validatorEngine);
new SchemaExport(c).Execute(true, true, false);
此节目
Error 1 'System.Reflection.Assembly' does not contain a definition for
'ValidationDefinitions' and no extension method 'ValidationDefinitions'
accepting a first argument of type 'System.Reflection.Assembly'
could be found (are you missing a using directive or an assembly reference?)
如果你们都能提供帮助的话。谢谢