Unity 2 - 为什么 BuildUp 方法发生了变化?
我开始使用 Unity 2 ,并愉快地使用了早期版本。我注意到 IUnityContainer.BuildUP(object obj) 方法已被删除。为什么会发生这种情况?
I am starting to use Unity 2 , having happily used earlier versions. I notice that the IUnityContainer.BuildUP(object obj) method has been removed. Why has this happened?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
就在这里,这是肯定的。它只是转移到扩展方法。
http://msdn .microsoft.com/en-us/library/microsoft.practices.unity.unitycontainerextensions_members(v=PandP.20).aspx
也许您没有
在某些情况下,您必须在迁移时添加它unity 1.2
以下重载是 IUnityContainer.BuildUp(object obj)(actualy BuildUp(T obj)) 的替换,因为 params ResolverOverride[] resolverOverrides 是可选的
http://msdn.microsoft.com/en -us/library/ff662062(v=PandP.20).aspx,因此您的代码应该无需任何更改即可编译
It's here, that's for shure. It's just moved to extension methods.
http://msdn.microsoft.com/en-us/library/microsoft.practices.unity.unitycontainerextensions_members(v=PandP.20).aspx
Perhaps you don't have
In some cases you'll have to add it when migrating from unity 1.2
The following overload is replacement for IUnityContainer.BuildUp(object obj)(actualy BuildUp(T obj)) becouse params ResolverOverride[] resolverOverrides are optional
http://msdn.microsoft.com/en-us/library/ff662062(v=PandP.20).aspx, so your code should compile without any changes