public Application(IShoppingCartContext shoppingCartContext, ICommandDispatcher commandDispatcher, IEventObserver eventObserver) { this.eventObserver = eventObserver; ShoppingCartContext = shoppingCartContext; this.commandDispatcher = commandDispatcher; }
private void SetupEnvironment() { var configs = new MongoDbConfigurations() { Host = "test", Port = 27017, Database = "TestDB" }; _context = new ShoppingCartContext(configs); }
private void RegisterHandlerFactories(IEventStore eventStore, ICommandDispatcher dispatcher, IShoppingCartContext shoppingCartContext) { RegisterHandlerFactoryWithTypes( () => new ShoppingCartEventHandler(shoppingCartContext), typeof(CartCreated), typeof(ProductAddedToCart), typeof(ProductRemovedFromCart), typeof(CartEmptied), typeof(CartCheckedOut)); RegisterHandlerFactoryWithTypes( () => new OrderEventHandler(new Repository(eventStore), dispatcher), typeof(OrderCreated), typeof(PaymentReceived), typeof(ShippingAddressConfirmed)); }
private void SetupEnvironment() { var dbGuid = new Guid(); var configs = new MongoDbConfigurations() { Database = dbGuid.ToString(), Host = "localhost", Port = 27017, User = "******", Password = "******" }; _context = new ShoppingCartContext(configs); _itemRepository = new ItemRepository(_context); }
public ItemRepository(IShoppingCartContext context) : base(context) { }
public EventHandlerFactory(IEventStore eventStore, ICommandDispatcher dispatcher, IShoppingCartContext shoppingCartContext) { RegisterHandlerFactories(eventStore, dispatcher, shoppingCartContext); }
protected CrudRepository(IShoppingCartContext context) { _mongoContext = context; _dbCollection = _mongoContext.GetCollection <TEntity>(typeof(TEntity).Name); }
public ShoppingCartRepository(IShoppingCartContext context) { _context = context; }
public ShoppingCartProvider(IShoppingCartContext db) { _db = db; _dbContext = _db.GetDbContext(); }
public ShoppingCartRepository(IShoppingCartContext shoppingCartContext) { _shoppingCartContext = shoppingCartContext; }
public ShoppingCartEventHandler(IShoppingCartContext context) { this.context = context; }