Given the following very simple linq statement
vm.VerifiedGroups = db.ReportGroups.Count(g => g.Verified);
or
vm.VerifiedGroups = db.ReportGroups.Count(g => g.Verified == true);
where is Verified bool, do I get an exception saying this is not supported by linq-2 entities?
Missed something very simple - or should I choose one of them:
a) vm.VerifiedGroups = db.ReportGroups.Where(g => g.Verified).Count();
or
b) vm.VerifiedGroups = db.ReportGroups.ToList().Count(g => g.Verified);
both of these work (and my list is longer than 30-50, so ToList is not a problem).
source share