title: Get a list of distinct items and their count
body: <p>I have an object, that has many properties but the only two to worry about are:</p>
  
  <p><code>myobject.ID</code> which is an <code>int</code><br />
  <code>myobject.Names</code> which is a <code>HashSet</code></p>
  
  <p>Then I have a <code>List</code> of those objects that looks something similar to this:</p>
  
  <pre><code>List&lt;myobject&gt;
  </code></pre>
  
  <p>I use Linq to get a some of the data into a repeater, but I'm not sure how to get the list of Names and how often they show up.</p>
  
  <p>Want to use Linq to avoid having to loop through the data.</p>
  
  <p>As my tags should show, this is an ASP.NET solution using C#.</p>
  
  <p><strong>Some clarification:</strong><br />
  Lets say I have just three items in my list:
  Item 1 has John, Fred, Jack in its names.
  Item 2 has John, Fred, Joe in its names.
  Item 3 has John in its names.</p>
  
  <p>I am trying to return the following:
  John - 3
  Fred - 2
  Jack - 1
  Joe - 1</p>
  
  <p>Also, as a note I am familiar with having to write my own comparer for my object, I'm just missing the 'how to' for the overall solution in my thoughts.</p>