Hi, I've discovered a serious bug : those queries don't return the same result:
The only difference is the ToList converting the IQueryable to a simple list. Sample project: [attachment=0:ie0iu504]DoTestSum.zip[/attachment:ie0iu504] Regards, Updated at 26.04.2010 15:31:58Thanks for your input : but it's not the real problem here. I will put below what I posted in the attached file: First, I create some entities:
Then the first query (that could be quite logically included in a global ToList() as you suggest)
Output is: 5,500000000000 Sum= 33,000000000000 Then I execute the first query (indeed this will translate in sql like this : SELECT * FROM Lines WHERE ...)
Output is : 5,500000000000 Sum= 12,000000000000 I will let you guess which one is correct ;) This thread was imported from our support forum. The original discussion may contain more detailed answer. |
Dmitri Maximov (Xtensive) wrote:Hello olorin, thanks for the sample. We'll start the investigation shortly. I've opened the following issue: http://code.google.com/p/dataobjectsdot ... ail?id=641 psulek wrote:I think i know what is wrong in this query:
calling ToList() is meaning as final projection, means that items from first of MyEntity object, all Lines objects are copied to generic list and on this list is made rest of conditions (group, sum, ...). And if i am right this is good and "by design". I think you can rewrite it to this:
to have generic list as an result of query. |