score:3

Accepted answer

You can use the Count overload that accepts a predicate:

var results = from message in context.inbox
              group message by message.Name into g
              select new 
              { 
                  Name = g.Key, 
                  Unread = g.Count(m => m.Status == "UNREAD"),
                  Total = g.Count()
              };

Related Articles