public void AddItems(IEnumerable <ShoppingCartItem> shoppingCartItems, Stores.IEventStore eventStore) { foreach (var item in shoppingCartItems) { if (_items.Add(item)) { eventStore.Raise("ShoppingCartItemAdded", new { UserId, item }); } } }
public void RemoveItems(int[] productCatalogueIds, Stores.IEventStore eventStore) { _items.RemoveWhere(i => productCatalogueIds.Contains(i.ProductCatalogId)); }