title: How to use a lambda expression in Enumerable.Distinct()
body: <p>I have an enumerable of objects for which I need to specify equality.</p>
  
  <pre><code>var values = list.Distinct();
  </code></pre>
  
  <p>Is there a way to use lambda expression in Enumerable.Distinct() or some equivalent workaround?</p>
  
  <pre><code>var values = list.Distinct((value1, value2) =&gt; value1.Id == value2.Id);
  </code></pre>