title: LINQ distinct on class item?
body: <p>Note this question is similar <a href="https://stackoverflow.com/questions/741299/linq-to-sql-distinct-with-anonymous-types">this one</a> except I'm not working with linq-to-sql, so the "let" is not usable.</p>
  
  <p>Basically I have a select of the type</p>
  
  <pre><code>... .Select(c =&gt; new SampleClass { Id = c.Location.Name, Name = c.Location.Name }).Distinct().ToList()
  </code></pre>
  
  <p>which used to work when I just had</p>
  
  <pre><code>... .Select(c =&gt; c.Location.Name).Distinct().ToList()
  </code></pre>
  
  <p>How would I make a distinct call on one of the items within the SampleClass?</p>