title: Subsonic 3 and Linq Group by with Count
body: <p>I have the following two tables:</p>
  
  <pre><code>Customer
  {
  int Id
  int Name
  }
  
  Bills
  {
  int Id
  int CustomerId
  decimal Amount
  bool IsDue
  }
  </code></pre>
  
  <p>Now I am trying to get a list where I have:</p>
  
  <ol>
  <li>A entry for every customer with the count of associated bills.</li>
  <li>A entry for every customer with the count of associated bills where IsDue is true.</li>
  </ol>
  
  <p>I tried doing the first one like this:</p>
  
  <pre><code>var results = from c in _db.Customers
                join b in _db.Bills on c.Id equals b.CustomerId into j1
                from j2 in j1
                group j2 by c.Id into grouped
                select new
                    {
                        CustomerId = grouped.Key, 
                        NoOfBills = grouped.Count()
                    };
  </code></pre>
  
  <p>This is throwing a error:
  Expression of type 'System.Collections.Generic.IEnumerable<code>1[OutstandingMonitor.MonitorData.Customer]' cannot be used for parameter of type 'System.Linq.IQueryable</code>1[OutstandingMonitor.MonitorData.Customer]' ...</p>
  
  <p>Please help me solve this.</p>
  
  <p>Further, can both the queries be combined?</p>
  
  <p>PS: Using Subsonic 3.0.0.3 with ActiveRecord</p>