Author: khand | Posted on: 1/27/2009 11:49:53 AM | Views : 232

 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 ...