protected Domain(EventEmitter emitter, EventCollector collector, EventStore store) { Current = this; Emitter = emitter; Collector = collector; Store = store; TransactionTracker = new TransactionTracker(emitter); }
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); }