title: Entity Framework returning distinct records issue
body: <p>I have a PC Enity which have some Properties , I would like to return a list of distinct Object (PC or Complex Type or whatever ) based on a property in order to bind it to server controls like DropDownList . And Because my method located in BLL I can't return anonymous type , So I created a Branch ComplexType which has two peroperties. </p>
  
  <p>I wrote like this but it have repeative records:</p>
  
  <pre><code>List&lt;Branch&gt; result = ( from p in _context.PCs
                          where p.UserId== userId
                          select new Branch()
                                     {
                                        BranchId= p.BranchId,
                                        BranchName=p.BranchName
                                     }).Distinct().ToList();
  </code></pre>
  
  <p><strong>Edit :</strong> 
  Thank you all , This worked : </p>
  
  <pre><code>List&lt;PC&gt; result = _context.PCs
                    .GroupBy(p=&gt;p.BranchName , p.BranchId})
                    .select(g=&gt;g.First())
                    .ToList();
  </code></pre>