title: Need to select multiple columns in Entity Framework, but need to get only distinct on single column
body: <p>I have a database table that has the following records.  There are more fields than what I have displayed below, but I only want to return the Owner, Brand Name, ID#, and Type fields.</p>
  
  <pre><code> Owner     Ingredient        BrandName    ID#       Type
  
    XXX       Methoprene       Precor        123-333    H
    XXX       Permethrin       Precor        123-333    H
  </code></pre>
  
  <p>I am trying to write an Entity Framework query to select only the distinct records in the Brand Name field, but still return the other columns in a list back to the controller to display in a partial view.  The following is the code I have attempted, but I cannot seem to get the query written correctly:</p>
  
  <pre><code>               return db.Pesticides
                          .Where(c =&gt; c.Owner == Owner &amp;&amp; c.BrandName == PesticidesBrand)
                          .GroupBy(c =&gt;  c.Owner, c =&gt;c.BrandName )
                          .Select(d =&gt; d.FirstOrDefault())
                          .ToList();
  </code></pre>
  
  <p>I realize the Select clause is not correct, but need help getting correct syntax to return the 4 specific fields.  I would like the query to return  the following record:</p>
  
  <pre><code>XXX  Precor    123-333  H
  </code></pre>
  
  <p>Thanks in advance....</p>