-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Closed
Copy link
Description
Our inline collection support currently supports constants:
public virtual Task Constant_Count_with_three_values(bool async)
=> AssertQuery(
async,
ss => ss.Set<PrimitiveCollectionsEntity>().Where(c => new[] { 2, 999, 1000 }.Count(i => i > c.Id) == 2),
entryCount: 2);While it's possible to also specify parameters, the NewArrayExpression gets client-evaluated by ParameterExtractingEV (because no database-correlated component), and so we get a single parameter for the array. This means we translate using OPENJSON, which isn't ideal - #30732 tracks doing a better translation to VALUES instead.
Beyond that, we could also allow arbitrary expressions:
var i = 2;
return AssertQuery(
async,
ss => ss.Set<PrimitiveCollectionsEntity>().Where(c => new[] { i, c.Int, SomeFunc(c.Foo) }.Contains(c.Id)),
entryCount: 1);The main blocker here is doing null semantics for InExpression over arbitrary expressions. Compensating to two-value logic isn't going to be easy...
Reactions are currently unavailable