Hello,
I've created a shopping cart class and i have a public function which adds an item and if it exists it
increases its quantity:
public void AddItem(Product p) {
CartItem newitem = new CartItem(p);
if(Items.Contains(newitem)) {
foreach (CartItem item in Items) {
if(item.Equals(newitem)) {
item.Quantity++;
return;
}
  ...
Go to the complete details ...