title: Fastest way to get matching items from two list c#
body: <p>I have two lists</p>
  
  <p>List1
  Only two property. 
  Cant use Dictionary since there might be duplicate keys.
  The combination of Property1 and Property2 is unique.</p>
  
  <pre><code>public class List1
  {
      public string Property1 { get; internal set; }
     public string Property2 { get; internal set; }
  }
  
  public class List2
  {
      public string Property1 { get; internal set; }
      public string Property2 { get; internal set; }
      public string Property3 { get; internal set; }
  }
  
  List&lt;List1&gt; mylist1 = new List&lt;List1&gt;() {
      new List1() {Property1="664",Property2="Ford" },
      new List1() {Property1="665",Property2="Ford" },
      new List1() {Property1="664",Property2="Toyota" },
  };
  
  List&lt;List2&gt; mylist2 = new List&lt;List2&gt;() {
      new List2() {Property1="664",Property2="Ford" ,Property3="USA"},
      new List2() {Property1="665",Property2="Ford" ,Property3="USA"},
      new List2() {Property1="664",Property2="Toyota" ,Property3="USA"},
      new List2() {Property1="666",Property2="Toyota" ,Property3="USA"},
  };
  </code></pre>
  
  <p>I need to get the matching items in mylist1 and mylist2. The match should happen only on Property1 and Property2. Property3 in the mylist2 can be ignored during comparison.</p>
  
  <p>Currently I use</p>
  
  <pre><code>var matchingCodes = mylist1.Where(l1 =&gt; mylist2.Any(l2 =&gt; (l2.Property1 == l1.Property1 &amp;&amp; l2.Property2==l1.Property2))).ToList();
  </code></pre>
  
  <p>which works perfectly fine. But is there a better way/ fastest way to do this?</p>
  
  <p>I can change List1 to any other Type. but not List2.</p>