Пример #1
0
        static void Main(string[] args)
        {
            XmlConfigurator.Configure();
            var builder = new PollerBuilder();

            builder.SetDescription("Event Queue Worker for Rewardle.Boilerplate")
            .SetDisplayName("Rewardle.Boilerplate.Events")
            .SetServiceName("Rewardle.Boilerplate.Events")
            .OverideServiceConfiguration(configurator => configurator.RunAsLocalSystem())
            .OnException((sender, ex) =>
            {
                ILog logger = LogManager.GetLogger(sender.GetType());
                if (ex is TargetInvocationException)
                {
                    ex = ex.InnerException;
                }
                logger.Error(ex.Message, ex);
                return(ex);
            })
            .RegisterComponents(b => BootstrapperTasks.RunAllInAssemblies(b, typeof(WireUpEventStore).Assembly,
                                                                          typeof(WireUpDispatchers).Assembly, typeof(WireUpThreadFactory).Assembly))
            .WithTask <AsyncEventWorker <BoilerplateEventThreadExecutor> >(
                "BoilerplateEventWorker", "Process the events of the Boilerplate services", 2)
            .Build()
            .Start();
        }
Пример #2
0
        IContainer GetContainer()
        {
            var builder = new ContainerBuilder();

            BootstrapperTasks.RunAllInAssemblies(builder, typeof(WireUpEventStore).Assembly,
                                                 typeof(WireUpDispatchers).Assembly);
            builder.RegisterApiControllers(typeof(TestController).Assembly).InstancePerRequest();
            IContainer container = builder.Build();

            return(container);
        }
Пример #3
0
        static IContainer GetContainer()
        {
            var containerBuilder = new ContainerBuilder();

            BootstrapperTasks.RunAllInAssemblies(containerBuilder, typeof(WireUpEventStore).Assembly,
                                                 typeof(WireUpDispatchers).Assembly);

            containerBuilder.RegisterAssemblyTypes(typeof(TestProjection).Assembly)
            .AsSelf();

            IContainer container = containerBuilder.Build();

            return(container);
        }