Pav*_*nin 5 .net c# dependency-injection unity-container interception
我像这样注册依赖项:
this.Container.RegisterType<IFoo, Foo>(
new ContainerControlledLifetimeManager(),
new InterceptionBehavior<PolicyInjectionBehavior>(), new Interceptor<InterfaceInterceptor>());
Run Code Online (Sandbox Code Playgroud)
这很好用。但是,当我解决Foo而不是IFoo出现错误时:
ArgumentException - 传递的类型必须是接口。
看来 Unity 仍在尝试应用InterfaceInterceptor此依赖项。但为什么?
| 归档时间: |
|
| 查看次数: |
68 次 |
| 最近记录: |