title: linq count error: DbExpressionBinding requires an input expression with a collection ResultType. Parameter name: input
body: <p>I'm trying to run the following linq query:</p>
  
  <pre><code>var entries = from entry in _db.Entries
      select new CommentSummary()
      {
           NumberOfComments = entry.Message.Count(),
           UserName = entry.Name
      };
  </code></pre>
  
  <p>when I execute the query, it throws the mentioned error:
  Message=DbExpressionBinding requires an input expression with a collection ResultType.
  Parameter name: input</p>
  
  <p>If I use </p>
  
  <pre><code>var entries = from entry in _db.Entries
      group entry by entry.Name into groupedByName
      orderby groupedByName.Count() descending
      select new CommentSummary
      {
           NumberOfComments = groupedByName.Count(),
           UserName = groupedByName.Key
      };
  </code></pre>
  
  <p>there is no error, but the Comments are not counted correctly: all NumberOfComments values are "1", and there should be some "1" and some "0".
  Any ideas?  Thanks</p>