title: LINQ query for removing all objects with an id not equal to a list of ids now workign properly
body: <p>In the <code>var workrolesusersdetailsQuery</code> after filtering I get a list of three <code>int?</code> ids. After that in the foreach loop I am simply trying to remove all the objects with id's not equal to the above mentioned id's. As a result it removes all the objects. The interesting part is that if i replace the <code>!=</code> with <code>==</code> then it is working properly.</p>
  
  <p>I just don't see what am i doing wrong, so, please, can somebody help? </p>
  
  <pre><code>var workrolesusersdetailsQuery = db.WorkRolesUsersDetails
              .Where(m =&gt; m.UserDetailsId == currentUserId &amp;&amp; m.isActive == true)
              .Select(m =&gt; m.WorkRoleId).ToList();//select only thw workroleid column
  
          foreach (var wr in workrolesusersdetailsQuery)
          {
              var temp = wr;
              WorkRolesQuery.RemoveAll((x) =&gt; x.WorkRoleId != wr);
  
          }
  </code></pre>