예제 #1
0
        public static PretendApplication Bootstrap(bool deleteDatabase = false)
        {
            if (app != null)
            {
                return(app);
            }

            //var store = new MongoDbEventStore(new TypeResolver()); // MongoDb Store
            var store = new InMemoryEventStore(); // In-Memory Event Store

            if (deleteDatabase)
            {
                store.DeleteDatabase();
            }

            var handlerFactory      = new CommandHandlerFactory(store);
            var eventHandlerFactory = new EventHandlerFactory(store, handlerFactory);
            var eventDispatcher     = new EventDispatcher(eventHandlerFactory);   // TODO Merge also EventDispatcher and EventHandlerFactory?
            var eventProcessor      = new EventProcessor(store, eventDispatcher); // TODO: what that here for?
            var dataReader          = new DataReader(store, eventHandlerFactory);

            app = new PretendApplication(handlerFactory, store, dataReader);
            return(app);
        }
예제 #2
0
 public BaseController()
 {
     App = Bootstrap();
 }
예제 #3
0
 public OrderController(PretendApplication app)
 {
     _app = app;
 }
예제 #4
0
 public EventConsumerController(PretendApplication app)
 {
     _app = app;
 }
 public ShoppingCartController(PretendApplication app)
 {
     _app = app;
 }
 public ShipmentController(PretendApplication app)
 {
     _app = app;
 }