title: Performant Way to Find/Match Each Item from One List Within Another List
body: <p>I have two Lists of two separate, but relatable classes.</p>
  <pre><code>class A
  {
      public int Id { get; set; }
      public string Name { get; set; }
      ...
  }
  </code></pre>
  <pre><code>class B
  {
      public int Id { get; set; }
      public string Name { get; set; }
      ...
  }
  </code></pre>
  <p>For each item in <code>List&lt;A&gt;</code>, I need to find its counterpart (<code>A.Id == B.Id</code>) in <code>List&lt;B&gt;</code>, if it exists, and then update <code>A.Name</code> from <code>B.Name</code>.</p>
  <p>I know how to do this easily enough. For example:</p>
  <pre><code>List&lt;A&gt;.ForEach(a =&gt;
  {
      a.Name = List&lt;B&gt;.FirstOrDefault(b =&gt; b.Id == a.Id)?.Name;
  });
  </code></pre>
  <p>This is, of course, very slow. I think O(n*m)? And I'm dealing with several million records in each List. I've searched for a better answer, but haven't come across anything directly applicable yet. Any help is appreciated!</p>