Esempio n. 1
0
 protected Domain(EventEmitter emitter, EventCollector collector, EventStore store)
 {
     Current = this;
     Emitter = emitter;
     Collector = collector;
     Store = store;
     TransactionTracker = new TransactionTracker(emitter);
 }
Esempio n. 2
0
        void WireupInfrastructure()
        {
            var bus = new FakeBus();
            var storage = new EventStore(bus);
            var repository = new Repository<Article>(storage);
            var discovery = new MessageHandlerDiscovery(bus);

            discovery.AddMessageReciever(new ArticleCommandHandler(repository));
            discovery.AddMessageReciever(new ArticleListEventHandler());
            discovery.AddMessageReciever(new ArticleDetailsEventHandler());
            discovery.AddMessageReciever(new ArticlePriceChangedEventHandler());

            ServiceLocator.RegisterBus(bus);
        }