-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Learning NServiceBus - Second Edition - Second Edition
By :
Dependency injection is a pattern that allows us to avoid hardcoded dependencies and define them at runtime. NServiceBus uses dependency injection to manage a host of dependencies, but the most visible dependency is the IBus dependency, which we take in our message handlers. We just declare a public instance of an interface as a property, and at runtime, NServiceBus will inject the runtime value that provides the implementation for that interface.
By default, NServiceBus will use the Autofac container (which is embedded within NServiceBus.Core.dll) for its own needs. In most cases, this is just fine, but if you already use a DI container and would like to integrate NuGet package with it directly, you can do so using one of the following NuGet packages that act as an adapter between NServiceBus and your chosen container:
NServiceBus.AutofacNServiceBus.CastleWindsorNServiceBus.NinjectNServiceBus.SpringNServiceBus.StructureMapNServiceBus.UnityEach package will contain a...
Change the font size
Change margin width
Change background colour