I'm pretty much looking for a port to Autofac that is implemented here with Castle Windsor. The IBus
is an interface provided by EasyNetQ library and I'd like to register a factory that would instantiate the IBus instance as a singleton. BusBuilder.CreateMessageBus
is the factory method. Example in Castle Windsor:
container.Register(
Component.For<IBus>()
.UsingFactoryMethod(BusBuilder.CreateMessageBus)
.LifestyleSingleton()
);