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