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); } } }
public void Handle(ShoppingCartRemovedProduct e) { PreCalculateShoppingCart(e.Id, e.ProductId, e.Quantity); }