title: Help with LINQ-SQL GroupBy
body: <p>I'm trying to convert this T-SQL to a LINQ-SQL query:</p>
  
  <pre><code>-- top 3 pros for city
  select top 3 description, ispro, COUNT(*) as numberofvotes
  from tblProCon
  where IdPrimaryCity = @IdPrimaryCity
  and IsPro = 1
  group by IdPrimaryCity, IsPro, description
  
  union
  
  -- top 3 cons for city
  select top 3 description, ispro, COUNT(*) as numberofvotes
  from tblProCon
  where IdPrimaryCity = @IdPrimaryCity
  and IsPro = 0
  group by IdPrimaryCity, IsPro, description
  
  order by ispro, numberofvotes desc
  </code></pre>
  
  <p>Here's what i have so far:</p>
  
  <pre><code>// Construct base query
  var query = (from p in db.tblProCons
               where p.IdPrimaryCity == idPrimaryCity
               group p by new { p.IdPrimaryCity, p.IsPro, p.Description } into g
               select new { Description = g.Key, IsPro = g.Any(x =&gt; x.IsPro), NumberOfAgrees = g.Count() });
  
  // Split queries based on pro/con, and apply TOP(3)
  var pros = query.Where(x =&gt; x.IsPro).Take(3);
  var cons = query.Where(x =&gt; !x.IsPro).Take(3);
  
  result = pros
      .Union(cons) // Union pro/cons
      .OrderByDescending(x =&gt; x.IsPro) // Order #1 - Pro/Con
      .ThenByDescending(x =&gt; x.NumberOfAgrees) // Order #2 - Number of Agree's
      .Select(x =&gt; new ProCon // project into cut-down POCO
              {
                  Description = x.Description,
                  IsPro = x.IsPro
              }).ToList();
  </code></pre>
  
  <p>But she ain't working. :(</p>
  
  <p><code>x.Description</code> is complaining "Cannot convert source type {IdPrimaryCity:int, IsPro:bool, Description:string} to target type string".</p>
  
  <p>All i want to end up with is a <code>List&lt;ProCon&gt;</code>, having the description (string), and flag indicating if it's a pro or con.</p>
  
  <p>What am i doing wrong?</p>