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.