static CompositionRoot() { var eventDispatcher = new LocalEventDispatcher(); var eventStore = new ActualEventStore( eventDispatcher, new EventSerializer(), new UserCredentials("admin", "changeit")); var roomRepo = new RoomRepository(eventStore); eventDispatcher.Subscribe(new CleaningRequestReportMessageHandler()); CommandDispatcher = new SingleProcessCommandDispatcher(); CommandDispatcher.Subscribe(new CleaningRequestHandler(roomRepo)); }
public static void Bootstrap() { var eventDispatcher = new LocalEventDispatcher(); //var eventStore = new InMemoryEventStore(eventDispatcher); var eventStore = new ActualEventStore(eventDispatcher); _roomRepo = new RoomRepository(eventStore); eventDispatcher.Subscribe(new CleaningRequestReportMessageHandler(), typeof(CleaningRequested)); //_commandDispatcher = new SingleProcessCommandDispatcher(); //var casted = (IHandleCommand<ICommand>) new CleaningRequestHandler(_roomRepo); //_commandDispatcher.Subscribe(casted, typeof(CleaningRequestCommand)); }