Comparison of generated query performance for Any () vs Count () in Entity Framework 4.1

I am working with Entity Framework 4.1 and C #.

Which one is best for better performance?

If so, why? (any links for additional readings)?

bool isBoarding = invoice.Allocations.Where(a => a.Service.Key == "boarding").Count() > 0; 

OR

 bool isBoarding = invoice.Allocations.Any(a => a.Service.Key == "boarding"); 
+7
source share
1 answer

Count I believe that all records will be overwritten, while Any will stop when it is first detected.

EDIT: Just found a great article that counter against anyone looked here

+8
source

All Articles