title: Replacing Distinct() with GroupBy(...) in Linq
body: <p>To get a performance gain, I am trying to replace the call to <code>Distinct()</code> below with <code>GroupBy(...)</code>, however I am getting errors.</p>
  
  <p>Any suggestions on how this query should be rewritten to use <code>GroupBy(...)</code>?</p>
  
  <p>I am trying to use <code>GroupBy()</code> on the <code>Description</code> field itself.</p>
  
  <pre><code>var result=
           GetResults()
          .Select(x =&gt; new SelectList { Text = x.Description, Value = x.Description })
                        .Where(x =&gt; x.Text != null)
                        .Distinct()
                        .ToList();
  </code></pre>
  
  <hr>