Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/262.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 无法使用ServiceLocator找到IValidator_C#_Nhibernate_S#arp Architecture - Fatal编程技术网

C# 无法使用ServiceLocator找到IValidator

C# 无法使用ServiceLocator找到IValidator,c#,nhibernate,s#arp-architecture,C#,Nhibernate,S#arp Architecture,使用sharparchitecture并尝试在域对象上调用IValidatable.IsValid时,出现以下错误 如何根据公共服务定位器注册NHibernate验证器的实例 我已经看到了以下单元测试: 如果您能帮上忙,我们将不胜感激 The needed dependency of type IValidator could not be located with the ServiceLocator. You'll need to register it with the Comm

使用sharparchitecture并尝试在域对象上调用IValidatable.IsValid时,出现以下错误

如何根据公共服务定位器注册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

很明显,当我意识到我没有在我的客户那里注册IValidator时,我有一瞬间大吃一惊。

你使用的是什么IoC容器?