Example #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);
        }
Example #2
0
 public BaseController()
 {
     App = Bootstrap();
 }
 public OrderController(PretendApplication app)
 {
     _app = app;
 }
Example #4
0
 public EventConsumerController(PretendApplication app)
 {
     _app = app;
 }
 public ShoppingCartController(PretendApplication app)
 {
     _app = app;
 }
 public ShipmentController(PretendApplication app)
 {
     _app = app;
 }