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
EF mistreats LINQ methods chained after FromSql #4780
Comments
@rowanmiller Let me do some more tests, I'm not sure it indeed because of the I'll update soon. |
@maumar @rowanmiller Anyway, it seems not to be related to the null coalescing operator but EF in general has issues with mixing LMK if you need examples. |
@gdoron first of all, many congratulations! 😄
Your query will still execute and should return correct results with We have talked about the possibility of extending the HTH. |
Cc @anpete |
@divega Thanks. I would change the error message to be more understandable it's because of the CTE. Just worth mentioning, using Select is being completely ignored. e.g.
Will return the |
In case I wasn't clear: You SQL query starts with the word "WITH", not with "SELECT", therefore it cannot be pushed down to a FROM clause to form a new query. Hence EF Core should execute you SQL string as is and then apply any additional LINQ operators in memory. If you are actually seeing that the LINQ operators are not applied at all and the results coming out of |
@divega by ignored I meant the emitted SQL isn't effected by the Select, and the results returned are the same with or without the Select. |
Ok, thank for reporting that! We will investigate but in the meanwhile a couple of things you can do to help:
|
@divega here is a simple repro demo: Regarding testing using the latest bits, I'm afraid I currently don't have the time to upgrade to RC2 by searching for fixes for all the breaking changes. |
@anpete can you take a look at losing the composed LINQ after non-composable FromSql call for RC2 |
@rowanmiller Sure. |
Confirmed the issue. |
I have created #4976 to track the idea that should enable CTE composition. |
I'm getting the following warning using RC-1-Final:
Code:
It's quite easy to translate the query to SQL (using
case
) and indeed it worked in earlier versions of EF.The text was updated successfully, but these errors were encountered: