-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Query: enable synthesizing rows from list/array of constant values to allow more queries to be server-evaluated #6660
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@fujiy what version are you using? (1.0 or nightly 1.1 build) |
1.0. Should I try with daily build? |
Any + Contains is not the problem here. Problem is the fact that termsSplit is a client side variable. In order to make this work on the server we would have to construct a row from a list of constants, which we currently don't do. Something like what EF6 does: SELECT N'Foo' AS [C1]
FROM ( SELECT 1 AS X ) AS [SingleRowTable1]
UNION ALL
SELECT N'Bar' AS [C1]
FROM ( SELECT 1 AS X ) AS [SingleRowTable2]) AS [UnionAll1] If we apply Any + Contains on a navigation property, e.g.: from b in ctx.Blogs
where b.Posts.Any(p => p.Content.Contains(p.Foo))
select b; we get a reasonable sql: SELECT [b].[Id]
FROM [Blogs] AS [b]
WHERE EXISTS (
SELECT 1
FROM [Posts] AS [p]
WHERE ((CHARINDEX([p].[Foo], [p].[Content]) > 0) OR ([p].[Foo] = N'')) AND ([b].[Id] = [p].[BlogId])) |
sending for re-triage |
I believe this is the issue we're having right now. var words = new[] { "foo", "bar" };
ctx.Post.Where(p => words.Any(p.Title.Contains)); We used
|
I used raw sql queries instead... kind of sucks to be forced to do that! |
Duplicate of #30426 |
Steps to reproduce
The issue
query2.Count()
causes aNullReferenceException
. But it shouldn't be evalute that query at client side:The text was updated successfully, but these errors were encountered: