title: Group Multiple Properties with Logical OR
body: <p>I have a class with multiple properties, of which I'm interested in two. Say, <code>PropA</code> and <code>PropB</code> in the following example.</p>
  <pre><code>public class GroupByOR
  {
      public string PropA { get; set; }
      public string PropB { get; set; }
      public int SomeNumber { get; set; }
      public GroupByOR(string a, string b, int num) { PropA = a; PropB = b; SomeNumber = num; }
  }
  </code></pre>
  <p>And I would like to group a list of this class' objects, criteria being an item should fall into a group if <strong>either</strong> <code>PropA</code> or <code>PropB</code> matches.</p>
  <p>For example, let's say my list looks like this:</p>
  <pre><code>List&lt;GroupByOR&gt; list = new List&lt;GroupByOR&gt;
  {
      new GroupByOR(&quot;CA&quot;, &quot;NY&quot;, 1), // Item 1
      new GroupByOR(&quot;CA&quot;, &quot;OR&quot;, 2), // Item 2
      new GroupByOR(&quot;NY&quot;, &quot;OR&quot;, 5)  // Item 3
  };
  </code></pre>
  <p>Then my desired outcome is this:</p>
  <blockquote>
  <p>Group 1: Items 1 and 2 (based on CA)</p>
  <p>Group 2: Items 1 and 3 (based on NY)</p>
  <p>Group 3: Items 2 and 3 (based on OR)</p>
  </blockquote>
  <p>Looking around, I found <a href="https://stackoverflow.com/questions/373541/how-to-do-joins-in-linq-on-multiple-fields-in-single-join">this</a> and many other examples, but they all seem to focus on grouping by multiple properties, but with an <code>AND</code> operation.</p>
  <p>Is what I'm trying to achieve even possible?</p>
  <p>Or else is <code>join</code> the way to go here? If so can you please direct me in the right direction?</p>