コード例 #1
0
ファイル: Domain.cs プロジェクト: AndyHitchman/BlastTrack
 protected Domain(EventEmitter emitter, EventCollector collector, EventStore store)
 {
     Current = this;
     Emitter = emitter;
     Collector = collector;
     Store = store;
     TransactionTracker = new TransactionTracker(emitter);
 }
コード例 #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);
        }