Example.
The entity contains a follow records:
- "Some text"; 1
- "Some text"; 1
- "Some text"; 2
- "Some text"; null
- "Other text"; 1
- "Other text"; null
Then i try to select records with Distinct() method.
var distinct = (from a in session.Query.All<MyEntity>()
select new
{
a.Text,
TstInt = a.TstInt == null ? true : a.TstInt == 1 ? true : false
}).Distinct();
And result is incorrect.
If i use ToArray() before Distinct() result is correct.
What does it mean? And why this happened?
sample: click for download.
asked
Apr 18 '11 at 06:34
Fateev Anton
5●1●1●2
Hello Anton,
Could you please specify which version of DataObjects.Net and which data provider you use. The answer should be posted as a comment to this one.
Thanks
DataObjects.Net 4.4.0 and sqlserver provider. I add the sample!
OK, I'll check this.
BTW, the sample is not accessible.
I hope now works.
Yes, works fine. Thanks.
I testted it now, and bug is also in "in-memory" internal DO4 provider. It returns this:
And it should returns:
It should return 3 records, i think :
The bug is confirmed. To be fixed.
Sorry, 3 records is correct, just copied wrong text ;-)
Hi! Do you have any progress to this problem?
Unfortunately, no.
Bug created 4 years ago, it's time to fix it!