Exemple #1
0
        public virtual void AddItem(EShopProduct product, int quantity)
        {
            CartLine line = lineCollection.Where(p => p.Product.EShopProductId == product.EShopProductId).FirstOrDefault();

            if (line == null)
            {
                lineCollection.Add(new CartLine
                {
                    Product  = product,
                    Quantity = quantity
                });
            }
            else
            {
                line.Quantity += quantity;
            }
        }
Exemple #2
0
 public virtual void RemoveLine(EShopProduct product) => lineCollection.RemoveAll(l => l.Product.EShopProductId == product.EShopProductId);