title: Linq distinct - Count
body: <p>I am looking to perform a query on an example list of objects</p>
  
  <pre><code>Date     Username
  
  01/01/2011 james
  01/01/2011 jamie
  01/01/2011 alex
  01/01/2011 james
  02/01/2011 matt
  02/01/2011 jamie
  02/01/2011 alex
  02/01/2011 james
  02/01/2011 james
  02/01/2011 lucy
  02/01/2011 alex
  03/01/2011 james
  03/01/2011 bob
  03/01/2011 bob
  03/01/2011 james
  03/01/2011 james
  04/01/2011 alex
  04/01/2011 alex
  04/01/2011 alex
  </code></pre>
  
  <p>I want to use linq to query the list of dates with the number of unique user logins.</p>
  
  <p>For example:</p>
  
  <pre><code>01/01/2011 - 3
  02/01/2011 - 5
  03/01/2011 - 2
  04/01/2011 - 1
  </code></pre>
  
  <p>I have tried as tested a number of linq statements but none of these are giving me the desired result. The closest I have got is giving me the distinct dates but with a count of all the users.</p>
  
  <p>Any help would be greatly appreciated.</p>