title: Find distinct values from a list of object by one field only
body: <p>How to select distinct values from a list of objects?
  I want to get only a list of specific field but not a list of the whole object.</p>
  
  <p>For example the collection to be queried:</p>
  
  <pre><code>name   year
  Item1  2009
  Item2  2009
  Item3  2010
  Item4  2010
  Item5  2011
  Item6  2011
  </code></pre>
  
  <p>and from that I want to return distinct years to get the below result collection</p>
  
  <pre><code>2009
  2010
  2011
  2012
  </code></pre>
  
  <p>I tried</p>
  
  <pre><code>distinctyears = myCollection.GroupBy(x =&gt; x.year).Select(x =&gt; x.First()).ToList();
  </code></pre>
  
  <p>but that will return a collection of the whole object instead of only the year values.</p>