title: How to select distinct with linq when comparing values
body: <p>I need to do a select distinct where I compare 2 values. In the method I do the following:</p>
  
  <pre><code>DistinctErrors = Errors.Select(o =&gt; new { o.Type, o.References })
                         .Distinct()
                         .Count();
  </code></pre>
  
  <p>o.Type is a string, but o.References is a Collection of objects. Each object in o.References has a Name property as string and a Value Property as string, and it's actually o.Type and each o.Reference's Name and Value values I want to compare, so it's actually 3 values to compare. </p>
  
  <p>How can I compare Type with each Reference Name and Value?</p>
  
  <p>Thanks,
  Peter</p>