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