title: Match values in two different lists using Linq
body: <p>Apologies if this has been asked before, I couldn't find an answer to my question.</p>
  
  <p>I have two lists, lets say:</p>
  
  <pre><code>List&lt;Job&gt; jobs;
  List&lt;Period&gt; periods;
  </code></pre>
  
  <p>The classes Job and Period contain an identifier, JobID, which is used to link them together. In the two lists there is a 1:1 relationship between these objects, i.e. for each Job there is 1 Period.</p>
  
  <p>What is the most efficient way using Linq to pair each Job with its corresponding period? I am currently doing this:</p>
  
  <pre><code>Period matchingPeriod;
  for (int i = 0; i &lt; jobs.Count; i++)
  {
      matchingPeriod = periods.Single(j =&gt; j.JobID== jobs[i].JobID);
      //other code 
  }
  </code></pre>
  
  <p>But in  large datasets this takes ages.
  Many thanks.</p>