Closed
Description
(from invoice in Session.Query.All<Invoice>()
let foo = invoice.InvoiceId.In(nonExistingIds) // This line incorrectly works as additional filter.
// Must not have any impact
where invoice.InvoiceId.In(existingIds)
select invoice).Count();
The expression:
{All().Select(invoice => new <>f__AnonymousType231`2(invoice = invoice, foo = invoice.InvoiceId.In(value(Xtensive.Orm.Tests.Linq.InTest+
<>c__DisplayClass37_0).nonExistingIds))).Where(<>h__TransparentIdentifier0 =>
<>h__TransparentIdentifier0.invoice.InvoiceId.In(value(Xtensive.Orm.Tests.Linq.InTest+<>c__DisplayClass37_0).existingIds)).Select(<>h__TransparentIdentifier0 => <>h__TransparentIdentifier0.invoice)}
The test to reproduce it:
https://github.com/DataObjects-NET/dataobjects-net/pull/401/files
Looks like let
works as where
filter.
It is a simlified example.
In the real app we discovered the same effect with used variable in let
.
We thought the behavior changed after merging https://github.com/dataObjects-net/dataobjects-net commits for last 7 months.
But after some investigation I see the bug is here for longer time, may be from the beginning.
Metadata
Metadata
Assignees
Labels
No labels