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(); }
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 }); } } }