title: MVC3: delete an object in an database from an array of selected objects
body: <p>I've successfully selected the Objects I want to delete. But the problem is when I remove an item from Object array, it doesn't make any changes. My code is following below..</p>
  
  <p>My database</p>
  
  <pre><code>public List&lt;Product&gt; db = new ProductRepository().GetProducts();
  </code></pre>
  
  <p>Here it shows all the products with checkbox..</p>
  
  <pre><code>public ActionResult MultipleDeletes()
          {
              return View(db);
          }
  </code></pre>
  
  <p>On Submitting "Button named Delete", I got problem.</p>
  
  <pre><code>[HttpPost]
          public ActionResult MultipleDeletes(int[] selectedProducts)
          {  
              var del_products  = from x in selectedProducts
                             from y in db
                             where y.ProductId == x
                             select y;
  
              foreach (var item in del_products)
              {
                  //Product p = db.Find(item.ProductId);
                  //db.Remove(p);
                  //db.SaveChanges();
              }                    
  
              return View(db);
          }
  </code></pre>
  
  <p>Could anyone help me?
  can you also tell me, how to write Lambda expression instead of LinQ?</p>