public IBus CreateBus(Action <IHandlerRegistry> handlerConfig, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var services = new ServiceCollection(); handlerConfig.Invoke(new HandlerRegistry(services)); services.AddRebus(configureBus); var provider = services.BuildServiceProvider(); container = new ActivatedContainer(provider); provider.UseRebus(); return(container.ResolveBus()); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> configureHandlers, out IActivatedContainer container) { var unityContainer = new UnityContainer(); configureHandlers.Invoke(new HandlerRegistry(unityContainer)); container = new ActivatedContainer(unityContainer); return(new UnityContainerAdapter(unityContainer)); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> configureHandlers, out IActivatedContainer container) { var registry = new HandlerRegistry(); configureHandlers(registry); var simpleInjContainer = new Container(); registry.ApplyRegistrations(simpleInjContainer); container = new ActivatedContainer(simpleInjContainer); return(new SimpleInjectorContainerAdapter(simpleInjContainer)); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> configureHandlers, out IActivatedContainer container) { var containerBuilder = new ContainerBuilder(); configureHandlers(new HandlerRegistry(containerBuilder)); var autoFacContainer = containerBuilder.Build(); container = new ActivatedContainer(autoFacContainer); return(new AutofacContainerAdapter(autoFacContainer)); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> configureHandlers, out IActivatedContainer container) { var kernel = new StandardKernel(); configureHandlers(new HandlerRegistry(kernel)); container = new ActivatedContainer(kernel); return(new NinjectContainerAdapter(kernel)); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> configureHandlers, out IActivatedContainer container) { var activator = new BuiltinHandlerActivator(); configureHandlers?.Invoke(new HandlerRegistry(activator)); container = new ActivatedContainer(activator); return(activator); }
public IBus CreateBus(Action <IHandlerRegistry> configureHandlers, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var dryContainer = CreateDryContainer(); configureHandlers.Invoke(new HandlerRegistry(dryContainer)); container = new ActivatedContainer(dryContainer); return(configureBus(Configure.With(new DryIocContainerAdapter(dryContainer))).Start()); }
public static IBus CreateBus(this IActivationContext context, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { return(context.CreateBus(registry => {}, configureBus, out container)); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> handlerConfig, out IActivatedContainer container) { var windsorContainer = new WindsorContainer(); handlerConfig.Invoke(new HandlerRegistry(windsorContainer)); container = new ActivatedContainer(windsorContainer); return(new CastleWindsorContainerAdapter(windsorContainer)); }
public IBus CreateBus(Action <IHandlerRegistry> handlerConfig, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var windsorContainer = new WindsorContainer(); handlerConfig.Invoke(new HandlerRegistry(windsorContainer)); container = new ActivatedContainer(windsorContainer); return(configureBus(Configure.With(new CastleWindsorContainerAdapter(windsorContainer))).Start()); }
public IBus CreateBus(Action <IHandlerRegistry> configureHandlers, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var lightInjectContainer = new ServiceContainer(); configureHandlers(new HandlerRegistry(lightInjectContainer)); container = new ActivatedContainer(lightInjectContainer); return(configureBus(Configure.With(new LightInjectContainerAdapter(lightInjectContainer))).Start()); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> configureHandlers, out IActivatedContainer container) { var lightInjectContainer = new ServiceContainer(); configureHandlers(new HandlerRegistry(lightInjectContainer)); container = new ActivatedContainer(lightInjectContainer); return(new LightInjectContainerAdapter(lightInjectContainer)); }
public IBus CreateBus(Action <IHandlerRegistry> configureHandlers, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var _containerBuilder = new ContainerBuilder(); configureHandlers(new HandlerRegistry(_containerBuilder)); var autoFacContainer = _containerBuilder.Build(); container = new ActivatedContainer(autoFacContainer); return(configureBus(Configure.With(new AutofacContainerAdapter(autoFacContainer))).Start()); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> configureHandlers, out IActivatedContainer container) { var sm = new Container(); configureHandlers.Invoke(new HandlerRegistry(sm)); container = new ActivatedContainer(sm); return(new StructureMapContainerAdapter(sm)); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> configureHandlers, out IActivatedContainer container) { var registry = new HandlerRegistry(); configureHandlers(registry); var simpleInjContainer = new Container { Options = { DefaultScopedLifestyle = ScopedLifestyle.Flowing, EnableAutoVerification = false //< disable verification for tests to avoid tricking instance counters in contract tests } }; registry.ApplyRegistrations(simpleInjContainer); container = new ActivatedContainer(simpleInjContainer); return(new SimpleInjectorContainerAdapter(simpleInjContainer)); }
public IBus CreateBus(Action <IHandlerRegistry> configureHandlers, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var sm = new Container(); configureHandlers.Invoke(new HandlerRegistry(sm)); container = new ActivatedContainer(sm); return(configureBus(Configure.With(new StructureMapContainerAdapter(sm))).Start()); }
public IBus CreateBus(Action <IHandlerRegistry> configureHandlers, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var registry = new HandlerRegistry(); configureHandlers(registry); var simpleInjContainer = new Container { Options = { DefaultScopedLifestyle = ScopedLifestyle.Flowing, EnableAutoVerification = false //< disable verification for tests to avoid tricking instance counters in contract tests } }; registry.ApplyRegistrations(simpleInjContainer); container = new ActivatedContainer(simpleInjContainer); //return configureBus(Configure.With(new SimpleInjectorContainerAdapter(simpleInjContainer))).Start(); simpleInjContainer.ConfigureRebus(configurer => configureBus(configurer).Start()); simpleInjContainer.StartBus(); return(simpleInjContainer.GetInstance <IBus>()); }
public static IHandlerActivator CreateActivator(this IActivationContext context, out IActivatedContainer container) { return(context.CreateActivator(handlers => { }, out container)); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> configureHandlers, out IActivatedContainer container) { var builder = new ContainerBuilder(); configureHandlers(new HandlerRegistry(builder)); var containerAdapter = new AutofacHandlerActivator(builder, (conf, con) => { }, startBus: false, enablePolymorphicDispatch: true); var autofacContainer = builder.Build(); container = new ActivatedContainer(autofacContainer); return(containerAdapter); }
public IBus CreateBus(Action <IHandlerRegistry> configureHandlers, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var kernel = new StandardKernel(); configureHandlers(new HandlerRegistry(kernel)); container = new ActivatedContainer(kernel); return(configureBus(Configure.With(new NinjectContainerAdapter(kernel))).Start()); }
public IBus CreateBus(Action <IHandlerRegistry> configureHandlers, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var containerBuilder = new ContainerBuilder(); configureHandlers(new HandlerRegistry(containerBuilder)); new AutofacHandlerActivator(containerBuilder, (conf, con) => configureBus(conf), startBus: true, enablePolymorphicDispatch: true); var autofacContainer = containerBuilder.Build(); container = new ActivatedContainer(autofacContainer); return(container.ResolveBus()); }
public IBus CreateBus(Action <IHandlerRegistry> configureHandlers, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var activator = new BuiltinHandlerActivator(); configureHandlers(new HandlerRegistry(activator)); container = new ActivatedContainer(activator); return(configureBus(Configure.With(activator)).Start()); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> handlerConfig, out IActivatedContainer container) { var services = new ServiceCollection(); handlerConfig.Invoke(new HandlerRegistry(services)); services.AddSingleton <IApplicationLifetime>(new TestLifetime()); var provider = services.BuildServiceProvider(); var adapter = new NetCoreServiceProviderContainerAdapter(provider); container = new ActivatedContainer(provider); return(adapter); }
public IBus CreateBus(Action <IHandlerRegistry> configureHandlers, Func <RebusConfigurer, RebusConfigurer> configureBus, out IActivatedContainer container) { var registry = new HandlerRegistry(); configureHandlers(registry); var simpleInjContainer = new Container(); registry.ApplyRegistrations(simpleInjContainer); container = new ActivatedContainer(simpleInjContainer); //return configureBus(Configure.With(new SimpleInjectorContainerAdapter(simpleInjContainer))).Start(); simpleInjContainer.ConfigureRebus(configurer => configureBus(configurer).Start()); simpleInjContainer.StartBus(); return(simpleInjContainer.GetInstance <IBus>()); }
public IHandlerActivator CreateActivator(Action <IHandlerRegistry> handlerConfig, out IActivatedContainer container) { var services = new ServiceCollection().AddSingleton(p => new DependencyInjectionHandlerActivator(p)); handlerConfig.Invoke(new HandlerRegistry(services)); var provider = services.BuildServiceProvider(); container = new ActivatedContainer(provider); return(provider.GetRequiredService <DependencyInjectionHandlerActivator>()); }