title: How to subtract one huge list from another efficiently in C#
body: <p>I have a very long list of Ids (integers) that represents all the items that are currently in my database:</p>
  
  <pre><code>var idList = GetAllIds();
  </code></pre>
  
  <p>I also have another huge generic list with items to add to the database:</p>
  
  <pre><code>List&lt;T&gt; itemsToAdd;
  </code></pre>
  
  <p>Now, I would like to remove all items from the generic list whose Id is already in the idList. 
  Currently idList is a simple array and I subtract the lists like this: </p>
  
  <pre><code>itemsToAdd.RemoveAll(e =&gt; idList.Contains(e.Id));
  </code></pre>
  
  <p>I am pretty sure that it could be a lot faster, so what datatypes should I use for both collections and what is the most efficient practice to subtract them? </p>
  
  <p>Thank you!</p>