Distinct().Count() returns incorrect value
Posted: Tue 28 Apr 2009 10:36
I'm currently using dotConnect for MySQL 5.20 Beta
I get incorrect value when trying to execute .Distinct().Count() expression.
Here is an example:
Count() method returns correct value if it is used without Distinct() method. But if they are used together, return value is always 1.
Thank you for your help in advance.
I get incorrect value when trying to execute .Distinct().Count() expression.
Here is an example:
Code: Select all
var query = DB.UserExamSubscriptions.Select(u => u.Id_user).Distinct();
int count = query.Count();
int realCount = 0;
foreach (int id in query)
{
realCount++;
}
// count == 1 (incorrect)
// realCount == 488 (correct)
Thank you for your help in advance.