-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
SelectMany cannot be translated when manually defined. #33679
Comments
@HT-Xaris we can try to take a look, but in general you have to construct a correct expression tree which matches what the C# compiler would construct; it's generally up to you to do this right. One could way to understand what you need to align to, is to use the debugger to inspect the expression tree produced without actually executing the query. For example: var query = context.Blogs.SelectMany(...); Since the query isn't actually evaluated (there's no e.g. ToListAsync() at the end), query is an IQueryable, and you can look at the debugger to understand exactly what the correct structure looks like. Then, compare that to what you have constructed manually, and make sure things match - this way you can find the discrepancy and fix your code. |
We can close the question. I tried what you described and also looked into the opcodes by ildasm. Thanks for your time. We can close the question. |
Ask a question
Can someone help me, finding the mistake in the given code to generate a SelectMany-Expression?
Currently, I'm unable to resolve the parent parameter inside the "Where"-Expression.
It works agains an in memory list but fails on sql translation.
Include your code
Program.cs
Include stack traces
Include provider and version information
csproj:
The text was updated successfully, but these errors were encountered: