title: Foreach a list<tuple> in an ordered fashion
body: <p>I have list that is populated with data from my entityframework. This data is ordered by an ID.</p>
  
  <p>I want to foreach this list in an ordered fashion so i can register which ID has already been processed. Because the ID in the list can occur more than once.</p>
  
  <p>So basically its like this:</p>
  
  <pre><code>List&lt;int&gt; matchedIDs = new List&lt;string&gt;();
  foreach(var item in tupleList)
  {
     if(matchedIDs.contains(item.ID))
      {
       // do something
      }
      else
      {
       // do something else
      }
   } 
  </code></pre>
  
  <p>Can this be done. So each time a new item come up in the foreach is the item with the same ID ?</p>
  
  <p>PS: i am interested in matching duplicates because im inserting items in a csv file. So if the first item in tuple is the same then should not insert a new row but use the existing.</p>