public virtual void AddItem(SerializableWatchModel product, int quantity) { // check to see if the product is already in the cart CartLine item = lineCollection.Where(p => p.Product.Id == product.Id).FirstOrDefault(); // add product or update quantity if (item == null) { lineCollection.Add(new CartLine { Product = product, Quantity = quantity }); } else { item.Quantity += quantity; } }
public override void AddItem(SerializableWatchModel product, int quantity) { base.AddItem(product, quantity); Session.SetJson("Cart", this); }