public static BusSetup UseAutofac(this BusSetup setup, ILifetimeScope componentContext) { setup.AddService <IComponentContext>(componentContext); setup.AddService <ILifetimeScope>(componentContext); setup.AddService <IServiceContainer>(c => new ScopeServiceContainer(componentContext, c)); return(setup); }