示例#1
0
        void Apply(ShoppingCartRemovedProduct e)
        {
            var temp = _items.SingleOrDefault(i => i.ProductId == e.ProductId);

            if (temp != null)
            {
                temp.Quantity   = e.Quantity;
                temp.TotalPrice = e.TotalPrice;
                if (temp.Quantity <= 0)
                {
                    _items.RemoveAll(i => i.ProductId == e.ProductId);
                }
            }
        }
示例#2
0
 public void Handle(ShoppingCartRemovedProduct e)
 {
     PreCalculateShoppingCart(e.Id, e.ProductId, e.Quantity);
 }