Esempio n. 1
0
        public void Start()
        {
            var registry          = new Registry();
            var componentRegistry = new StructureMapComponentRegistry(registry);

            componentRegistry.Register <IAzureStorageConfiguration, DefaultAzureStorageConfiguration>();
            componentRegistry.RegisterDataAccess();
            componentRegistry.RegisterSubscription();
            componentRegistry.RegisterServiceBus();

            _bus = new StructureMapComponentResolver(new Container(registry)).Resolve <IServiceBus>().Start();
        }
Esempio n. 2
0
        private static void Main(string[] args)
        {
            var registry          = new Registry();
            var componentRegistry = new StructureMapComponentRegistry(registry);

            componentRegistry.Register <IAzureStorageConfiguration, DefaultAzureStorageConfiguration>();
            componentRegistry.RegisterServiceBus();

            using (var bus = new StructureMapComponentResolver(new Container(registry)).Resolve <IServiceBus>().Start())
            {
                string userName;

                while (!string.IsNullOrEmpty(userName = Console.ReadLine()))
                {
                    bus.Send(new RegisterMemberCommand
                    {
                        UserName = userName
                    });
                }
            }
        }