Sorry if this has been asked, but how can I improve the following with a single call to the database?
var statsModel = new { Total = _db.Messages.Count(
This might help:
var statsModel =( from message in _db.Messages group message by 1 into g select new { Total = g.Count(), Approved =g.Count (x =>x.Approved), Rejected =g.Count (x =>!x.Approved) } ).FirstOrDefault();