title: Why DistinctBy does not contain a definition?
body: <p>I have a table of product specifications I do not want duplicate elements to be displayed when displaying product specifications. I did this, but the error is displayed. Where did I go wrong?</p>
  <p>And displays this error:
  'IEnumerable' does not contain a definition</p>
  <pre><code> private static List&lt;ProductPropertiesQueryModel&gt; 
    MapProductProperties(List&lt;ProductProperties&gt; ProductProperties)
      {
         return ProductProperties
          .Select(x=&gt;new ProductPropertiesQueryModel
          {
             ProductId =x.ProductId,
             Color =x.Color,
             Size=x.Size
          }).DistinctBy(r=&gt;r.Color).ToList();                      
      }
  </code></pre>