0
使用锐构架时出现以下错误,并尝试在域对象上调用IValidatable.IsValid。无法通过ServiceLocator找到IValidator
我该如何注册一个NHibernate验证器的实例来对付公共服务定位器?
我看到下面的单元测试:
任何帮助,这将真正理解。
The needed dependency of type IValidator could not be located with the ServiceLocator. You'll need to register it with the Common Service Locator (CSL) via your IoC's CSL adapter.
at SharpArch.Core.SafeServiceLocator`1.GetService() in C:\MyStuff\Projects\SharpArchGitHub\src\SharpArch\SharpArch.Core\SafeServiceLocator.cs:line 29
at SharpArch.Core.DomainModel.ValidatableObject.IsValid() in C:\MyStuff\Projects\SharpArchGitHub\src\SharpArch\SharpArch.Core\DomainModel\ValidatableObject .cs:line 11
at Tuhdoo.Common.Validation.ValidatableExtensions.Validate(IValidatable entity) in D:\Repository\Tuhdoo\src\Tuhdoo.Common\Validation\ValidatableExtensions.cs:line 26
您使用的是什么IoC容器? – 2010-02-09 02:23:59