C# IUnityContainer 解析方法
我创建了一个简单的 PRISM 应用程序,其中包含继承自 UnityBootstrapper 的标准引导程序。
UnityBootstrapper 又具有公共属性 IUnityContainer 并且该接口具有以下解析签名:
object Resolve(Type t, string name, params ResolverOverride[] resolverOverrides);
现在,我不知道如何获取描述的其他解析方法 此处。
我是否将 Unity 与其 IUnityContainer 接口混淆了?
I've created a simple PRISM application with a standard bootstrapper inherited from UnityBootstrapper.
The UnityBootstrapper in turn has the public property IUnityContainer and this interface has the following resolve singature:
object Resolve(Type t, string name, params ResolverOverride[] resolverOverrides);
Now, I don't know how to get the other resolve methods which are described here.
Am I confusing Unity with its IUnityContainer interface?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
在 Unity 1.2 中,
IUnityContainer
拥有所有这些可用重载。在Unity 2.0中,您需要带上
UnityContainerExtensions
在范围内,因为您想要的重载被定义为此类的扩展方法。In Unity 1.2,
IUnityContainer
had all of those overloads available.In Unity 2.0, you need to bring
UnityContainerExtensions
in scope because the overloads you want are defined as extension methods on this class.IUnityContainer
具有以下解析方法:http://msdn.microsoft.com/en-us/library/microsoft.practices.unity.iunitycontainer.resolve.aspx
IUnityContainer
has the following resolve methods:http://msdn.microsoft.com/en-us/library/microsoft.practices.unity.iunitycontainer.resolve.aspx
这些方法是扩展方法
签名:
因此,如果您已经实现了
IUnityContainer
,则可以使用它们。These methods are extension methods
Signature:
So if you have implemented
IUnityContainer
you can use them.