StructureMap

Project Hosting | Nuget: NServiceBus.StructureMap (Version: 3.x)
Target NServiceBus Version: 3.x
Standard support for version 3.x of NServiceBus has expired. For more information see our Support Policy.

NServiceBus can be configured to use StructureMap as a dependency injection container.

Default Usage

Edit
configure.StructureMapBuilder();

Existing Container Instance

Edit
var container = new Container(
    action: expression =>
    {
        expression.For<MyService>()
            .Use(new MyService());
    });
configure.StructureMapBuilder(container);

DependencyLifecycle Mapping

The DependencyLifecycle map to StructureMap Lifecycle in the following way.

DependencyLifecycleStructureMap Lifecycle
InstancePerCallAlwaysUnique
InstancePerUnitOfWorkContainerScoped
SingleInstanceSingleton

Last modified