NServiceBus can be configured to use Unity for dependency injection.
var container = new UnityContainer(); container.RegisterInstance(new MyService()); configure.UnityBuilder(container);
The DependencyLifecycle maps to Unity in the following way.
|InstancePerCall||Transient Lifetime Manager|
|InstancePerUnitOfWork||Hierarchical Lifetime Manager|
|SingleInstance||Container Controlled Lifetime Manager|
Breaking changes in Unity will be handled as follows:
- Changes that require a change to the
NServiceBus.API (e.g. changes to
IUnityContainer) will be released in a new major version of
- Changes that do not require a change to the
NServiceBus.API will be released as a patch release to the latest minor version of
- If Unity releases a new major version, it will be supported in a new minor release of