title: Intersecting two list of dictionary by values of only specific keys C#
body: <p>I have two list of dictionaries of varying lengths. The keys in both the dictionary are identical and the values may not be.</p>
  
  <pre><code>var A = List&lt;Dictionary&lt;string, object&gt;&gt;();
  var B = List&lt;Dictionary&lt;string, object&gt;&gt;();
  </code></pre>
  
  <p>I would like to intersect A and B abased on the values of 3 keys in the in the dictionary object contained in them.</p>
  
  <p>For eg:</p>
  
  <pre><code>var dict = new Dictionary&lt;string,object&gt;{{"W",val1},{"X",val2},{"Y",val3},{"Z",val4}}
  </code></pre>
  
  <p>Dictionary similar to above is contained in the list A and B with varying values for val1,val2,val3,val4. I want to intersect A and B if values for keys W,X,Y are equal but I dont care about the value in Z for intersection. Is there a way to achieve this elegantly?</p>
  
  <p>Elaborating with an example:</p>
  
  <pre><code>   A.add(new Dictionary&lt;string,object&gt;{{"W",123},{"X",456},{"Y",789},{"Z",103}});
     A.add(new Dictionary&lt;string,object&gt;{{"W",124},{"X",456},{"Y",789},{"Z",893}});
     A.add(new Dictionary&lt;string,object&gt;{{"W",123},{"X",456},{"Y",789},{"Z",134}});
  
     B.add(new Dictionary&lt;string,object&gt;{{"W",123},{"X",456},{"Y",789},{"Z",900}});
     B.add(new Dictionary&lt;string,object&gt;{{"W",124},{"X",456},{"Y",789},{"Z",893}});
     B.add(new Dictionary&lt;string,object&gt;{{"W",212},{"X",321},{"Y",789},{"Z",134}});
  </code></pre>
  
  <p>If I do A.intersect(B), I would like to get the following list back,</p>
  
  <pre><code>{"W",123},{"X",456},{"Y",789},{"Z",103}
  {"W",123},{"X",456},{"Y",789},{"Z",900}
  {"W",124},{"X",456},{"Y",789},{"Z",893}
  </code></pre>