NServiceBus使用Unity 2.0? [英] NServiceBus with Unity 2.0?

查看:195
本文介绍了NServiceBus使用Unity 2.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何使用NServiceBus 2.0成功使用Unity 2.0?

Anyone using NServiceBus 2.0 successfully with Unity 2.0?

我已经试过编译NServiceBus.ObjectBuilder.Unity.dll来源反对统一2.0组件,但由于得到了在新的统一多对象方法的改变/删除签名的几个编译错误。

I've tried to compile sources of NServiceBus.ObjectBuilder.Unity.dll against Unity 2.0 assemblies but got several compile-time errors because of changed/deleted signatures of many object methods in new Unity.

在文档乌迪大汉说的附加任何容器作为实施5种方法一样简单的IContainer 。但是,当我看着NServiceBus.ObjectBuilder.Unity实现我看到有很多工作要做。为什么是这样呢?

In the documentation Udi Dahan says that attaching any container is as easy as implementing 5 methods of IContainer. But when i look into NServiceBus.ObjectBuilder.Unity implementation i see that there is a LOT more work to be done. Why it is so?

推荐答案

团结,在默认情况下,行为从什么NSB期望不同。这就是为什么有必要进行一些自定义的扩展,使之与ObjectBuilder的合同兼容。有两个主要的不同:

Unity, by default, behaves different from what NSB expects. That's why there is a need for some custom extensions to make it compatible with ObjectBuilder contract. There are two major differences:

  • 统一要求DependencyAttribute到 依赖注入到该属性。 NSB预计ObjectBuilder的注入 在任何财产与匹配的 键入
  • 在做财产注入 统一对待性依赖关系 必需的,而NSB希望他们 是可选的。
  • Unity requires DependencyAttribute to inject dependency into the property. NSB expects ObjectBuilder to inject in any property that with matching type
  • When doing property injection unity treats property dependencies as mandatory whereas NSB expects them to be optional.

我相信,这些功能都pserved 2.0版$ P $,这将是很容易迁移它们。我应该有一段时间了,本周,我希望我将建立一个统一V2实现。我要让你知道,当它完成了。

I believe that these features are preserved in version 2.0 and it will be easy to migrate them. I should have some time this week and I hope I will create a Unity v2 implementation. I'll let you know when it's finished.

编辑: 完成。该股2目标建设者是在树干。

Done. The Unit 2 object builder is in the trunk.

这篇关于NServiceBus使用Unity 2.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆