title: Why does adding a list to another list, using add range, remove the elements from the first list?
body: <p>Consider the following example:</p>
  
  <pre><code>IEnumerable&lt;Int32&gt; groupsToAdd = new List&lt;Int32&gt;();
  
  List&lt;Int32&gt; groups1 = new List&lt;Int32&gt;() { 1,2,3 };
  List&lt;Int32&gt; groups2 = new List&lt;Int32&gt;() { 3,4,5 };
  
  groupsToAdd = groups1.Where(g =&gt; false == groups2.Contains(g));
  
  groups2.AddRange(groupsToAdd);
  
  groupsToAdd.Dump();
  </code></pre>
  
  <p>When <code>groupsToAdd.Dump()</code> is called the list is now empty. I've looked up the AddRange reference and it doesn't mention that the elements are removed from list but when i test this code (in linqpad) it ends empty. Why is this?</p>
  
  <p>Edit:
  To clarify, I mean that the elements are being removed from <code>groupsToAdd</code> because before <code>groups2.AddRange(groupsToAdd)</code> groupsToAdd is populated with two elements</p>