Пример #1
0
        static void Main1(string[] args)
        {
            var container = new LightInject.ServiceContainer();

            container.RegisterRouter(new IRouterConfigurationSource[] { new RouterConfigurationSourceSample() });
            container.RegisterFrom <ServiceLocatorCompositionRoot>();
            container.RegisterAzureServiceBusRouter();

            container.Register <IMessageHandler, MessageHandler>(typeof(MessageHandler).FullName, new PerContainerLifetime());

            var host = container.GetInstance <IHost>();

            host.Configuration.UsingAzureServiceBus();
            host.Run();
            Console.ReadLine();
        }