title: Linq group by query with count and other fields in mvc4
body: <p>I am writing linq query to get some details from table. I want to get count of <code>docStatus</code> with <code>"notVerified"</code> for each <code>clientID</code>.</p>
  
  <p>My table structure is as follows</p>
  
  <pre><code>ID     clientId  clientName     empID       docStatus
  1       IN1001    Infy           100        Verified
  2       IN1001    Infy           101        notVerified
  3       IN1001    Infy           102        notVerified
  </code></pre>
  
  <p>After querying I want data in the below form</p>
  
  <pre><code>clientID    clientName    Count
  IN1001      Infy          2   
  </code></pre>
  
  <p>This is what i tried below. I am able to get count but where i should put where condition in my below query.</p>
  
  <pre><code>var noofRecords = (from c in db.ts_upld_doc
                     group c by c.upld_docid into grouping
                     select new
                     {
                         key = grouping.Key,
                         Count = grouping.Count()
                     });
  return noofRecords.Count();
  </code></pre>
  
  <p>thank you in advance.</p>