Beispiel #1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);

            var bus = new FakeBus();

            var storage  = new EventStore(bus);
            var rep      = new Repository <InventoryItem>(storage);
            var commands = new InventoryCommandHandlers(rep);

            bus.RegisterHandler <CheckInItemsToInventory>(commands.Handle);
            bus.RegisterHandler <CreateInventoryItem>(commands.Handle);
            bus.RegisterHandler <DeactivateInventoryItem>(commands.Handle);
            bus.RegisterHandler <RemoveItemsFromInventory>(commands.Handle);
            bus.RegisterHandler <RenameInventoryItem>(commands.Handle);
            var detail = new InvenotryItemDetailView();

            bus.RegisterHandler <InventoryItemCreated>(detail.Handle);
            bus.RegisterHandler <InventoryItemDeactivated>(detail.Handle);
            bus.RegisterHandler <InventoryItemRenamed>(detail.Handle);
            bus.RegisterHandler <ItemsCheckedInToInventory>(detail.Handle);
            bus.RegisterHandler <ItemsRemovedFromInventory>(detail.Handle);
            var list = new InventoryListView();

            bus.RegisterHandler <InventoryItemCreated>(list.Handle);
            bus.RegisterHandler <InventoryItemRenamed>(list.Handle);
            bus.RegisterHandler <InventoryItemDeactivated>(list.Handle);
            ServiceLocator.Bus = bus;
        }
Beispiel #2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            RegisterRoutes(RouteTable.Routes);

            var bus = new FakeBus();

            var storage = new EventStore(bus);
            var rep = new Repository<InventoryItem>(storage);
            var commands = new InventoryCommandHandlers(rep);
            bus.RegisterHandler<CheckInItemsToInventory>(commands.Handle);
            bus.RegisterHandler<CreateInventoryItem>(commands.Handle);
            bus.RegisterHandler<DeactivateInventoryItem>(commands.Handle);
            bus.RegisterHandler<RemoveItemsFromInventory>(commands.Handle);
            bus.RegisterHandler<RenameInventoryItem>(commands.Handle);
            var detail = new InvenotryItemDetailView();
            bus.RegisterHandler<InventoryItemCreated>(detail.Handle);
            bus.RegisterHandler<InventoryItemDeactivated>(detail.Handle);
            bus.RegisterHandler<InventoryItemRenamed>(detail.Handle);
            bus.RegisterHandler<ItemsCheckedInToInventory>(detail.Handle);
            bus.RegisterHandler<ItemsRemovedFromInventory>(detail.Handle);
            var list = new InventoryListView();
            bus.RegisterHandler<InventoryItemCreated>(list.Handle);
            bus.RegisterHandler<InventoryItemRenamed>(list.Handle);
            bus.RegisterHandler<InventoryItemDeactivated>(list.Handle);
            ServiceLocator.Bus = bus;
        }
Beispiel #3
0
        protected void Application_Start(object sender, EventArgs e)
        {
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            MvcConfig.RegisterRoutes(RouteTable.Routes);
            MvcConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            _bus.RegisterHandler<CheckInItemsToInventory>(commands.Handle);
            _bus.RegisterHandler<CreateInventoryItem>(commands.Handle);
            _bus.RegisterHandler<DeactivateInventoryItem>(commands.Handle);
            _bus.RegisterHandler<RemoveItemsFromInventory>(commands.Handle);
            _bus.RegisterHandler<RenameInventoryItem>(commands.Handle);
            var detail = new InvenotryItemDetailView();
            _bus.RegisterHandler<InventoryItemCreated>(detail.Handle);
            _bus.RegisterHandler<InventoryItemDeactivated>(detail.Handle);
            _bus.RegisterHandler<InventoryItemRenamed>(detail.Handle);
            _bus.RegisterHandler<ItemsCheckedInToInventory>(detail.Handle);
            _bus.RegisterHandler<ItemsRemovedFromInventory>(detail.Handle);
            var list = new InventoryListView();
            _bus.RegisterHandler<InventoryItemCreated>(list.Handle);
            _bus.RegisterHandler<InventoryItemRenamed>(list.Handle);
            _bus.RegisterHandler<InventoryItemDeactivated>(list.Handle);
        }
Beispiel #4
0
        protected void Application_Start(object sender, EventArgs e)
        {
            WebApiConfig.Register(GlobalConfiguration.Configuration);
            MvcConfig.RegisterRoutes(RouteTable.Routes);
            MvcConfig.RegisterGlobalFilters(GlobalFilters.Filters);

            _bus.RegisterHandler <CheckInItemsToInventory>(commands.Handle);
            _bus.RegisterHandler <CreateInventoryItem>(commands.Handle);
            _bus.RegisterHandler <DeactivateInventoryItem>(commands.Handle);
            _bus.RegisterHandler <RemoveItemsFromInventory>(commands.Handle);
            _bus.RegisterHandler <RenameInventoryItem>(commands.Handle);
            var detail = new InvenotryItemDetailView();

            _bus.RegisterHandler <InventoryItemCreated>(detail.Handle);
            _bus.RegisterHandler <InventoryItemDeactivated>(detail.Handle);
            _bus.RegisterHandler <InventoryItemRenamed>(detail.Handle);
            _bus.RegisterHandler <ItemsCheckedInToInventory>(detail.Handle);
            _bus.RegisterHandler <ItemsRemovedFromInventory>(detail.Handle);
            var list = new InventoryListView();

            _bus.RegisterHandler <InventoryItemCreated>(list.Handle);
            _bus.RegisterHandler <InventoryItemRenamed>(list.Handle);
            _bus.RegisterHandler <InventoryItemDeactivated>(list.Handle);
        }