public ApplicationInProcessHost(Func <string, string> settingsResolver)
        {
            if (settingsResolver == null)
            {
                throw new ArgumentNullException(nameof(settingsResolver));
            }

            var applicationBusBuilder = new BusBuilder(settingsResolver);

            serviceHandle = new Application.Host.HostStarter(() => applicationBusBuilder.NewContainer(), settingsResolver);
        }
Ejemplo n.º 2
0
        public ServiceHost(Func <string, string> settingsResolver)
        {
            if (settingsResolver == null)
            {
                throw new ArgumentNullException(nameof(settingsResolver));
            }

            try
            {
                var busBuilder = new BusBuilder(settingsResolver);

                this.container = busBuilder.NewContainer();
                busControl     = container.Resolve <IBusControl>();
                busControl.Start();
            }
            catch (Exception ex)
            {
                throw;
            }
        }