title: LINQ to Objects Join two collections to set values in the first collection
body: <p>I have the following Entity Framework query:</p>
  
  <pre><code>var results = from r in db.Results
                select r;
  </code></pre>
  
  <p>I'm using AutoMapper to map to another type:</p>
  
  <pre><code>var mapped = Mapper.Map&lt;IEnumerable&lt;Database.Result&gt;, IEnumerable&lt;Objects.Result&gt;&gt;(results);
  </code></pre>
  
  <p>In my Objects.Result type, I have a property called reason that is not coming from the database. It is coming from another source that I need to basically populate back into my mapped type:</p>
  
  <pre><code>var reasons = new List&lt;Reason&gt;
  {
      new Reason { Id = 1, Reason = "asdf..." }
  };
  </code></pre>
  
  <p>I need to join the reasons with my mapped collection and set the Reason property in my mapped collection using the value from my reasons collection. Is this possible?</p>
  
  <pre><code> // need something like this:
   mapped = from m in mapped
            join r in reasons on m.Id equals r.Id
            update m.Reason = r.Reason
            select m;
  </code></pre>
  
  <p>Obviously the above code doesn't compile, but is there code I can write that does what I want?</p>