title: LINQ Entity Framework - The object cannot be deleted because it was not found in the ObjectStateManager
body: <p>I am using Entity Framework.
  I am trying to get the results from linq and then do a delete on them as such:</p>
  
  <pre><code>    IEnumerable&lt;tblAVAL&gt; tblval = db.tblVALs.Where(p =&gt; p.PgrID == prid);
      db.DeleteObject(tblval);
      db.SaveChanges(); 
  </code></pre>
  
  <p>Note that <code>tblval</code> returns a collection. I get the following message though:</p>
  
  <blockquote>
    <p>The object cannot be deleted because it was not found in the
    ObjectStateManager.</p>
  </blockquote>
  
  <p>If I do the following it works:</p>
  
  <pre><code>    tblAVAL tblval = db.tblVALs.First(p =&gt; p.PgrID == prid);
      db.DeleteObject(tblval);
      db.SaveChanges(); 
  </code></pre>
  
  <p>How can I get it to to delete with a collection that has more than 1 rows returned? </p>