What is the most performant way to count items on a table using EF 4.1?
this.context.MyTable.Count(x.idTenant == 5);
or
this.context.MyTable.Where(x.idTenant == 5).Count();
Any other way to Count entities in a table, being it more performant?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
According to the output from Linq, the expressions are equal in the SQL they generate: