Exemplo n.º 1
0
        public bool Start(HostControl hostControl)
        {
            BusHelper.Instance.StartAsync();

            var uri = "http://localhost:81";

            using (var host = new NancyHost(new Uri(uri)))
            {
                var container = new UnityContainer();

                container.RegisterType <FormularioConsumer>();

                _busControl = BusHelper.GetBusConfiguration(container);

                container.RegisterInstance <IBusControl>(_busControl);
                container.RegisterInstance <IBus>(_busControl);

                _busControl.Start();

                host.Start();

                Console.WriteLine($"On {uri}");
                Console.ReadLine();
            }

            return(true);
        }
Exemplo n.º 2
0
        public bool Start(HostControl hostControl)
        {
            var container = new UnityContainer();

            _busControl = BusHelper.GetBusConfiguration(container);

            container.RegisterInstance <IBusControl>(_busControl);
            container.RegisterInstance <IBus>(_busControl);

            _busControl.Start();

            return(true);
        }