public void AddItem(disks dissk, int quantity) { CartLine line = lineCollection .Where(g => g.disk.id == dissk.id) .FirstOrDefault(); if (line == null) { lineCollection.Add(new CartLine { disk = dissk, Quantity = quantity }); } else { line.Quantity += quantity; } }
public void RemoveLine(disks dissk) { lineCollection.RemoveAll(l => l.disk.id == dissk.id); }