Example #1
0
        public void AddItem(Hsuit hsuit, int quantity)
        {
            CartLine line = lineCollection.
                            Where(h => h.Hsuit.Id == hsuit.Id).
                            FirstOrDefault();

            if (line == null)
            {
                lineCollection.Add(new CartLine
                {
                    Hsuit    = hsuit,
                    Quantity = quantity
                });
            }
            else
            {
                line.Quantity += quantity;
            }
        }
Example #2
0
 public void RemoveLine(Hsuit hsuit)
 {
     lineCollection.RemoveAll(l => l.Hsuit.Id == hsuit.Id);
 }