-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
NotImplementedException thrown if predicate passed into a linq method from within an expression tree #16104
Comments
First, many thanks for trying preview 6. We really appreciate people trying the previews and filing issues on what they find. If you haven't seen it already, there is some good information in the preview announcement post about the changes that are happening to LINQ queries for EF Core 3.0. Preview 6 is the first release containing these changes, which means we are both expecting things to be broken, but at the same time very grateful for everyone who tries the release and generated feedback. @smitpatel In triage we came to the conclusion that this isn't something that worked in previous versions, but that it would likely work in 3.0. Is this correct, and if so is there an issue already tacking it? |
We need to investigate this since it should already be working. There are few places which needs to work out to translate it correctly.
@arcooke - Can you verify the predicate passed into FirstOrDefault as it is always true? Is that typo or valid? |
@ajcvickers Happy to help.. Oddly enough, I was on preview 5 when I first encountered this, and updated to 6 to see if it had been fixed. I just now reverted everything back to preview 5 (19227.1) to re-test, and now the same code posted above works fine. I may have temporarily had a version mismatch somewhere since I used wildcards for nuget package versions ( Preview 6 still breaks here, but 5 is working. Just verified with the identical code as posted above. Working:
Not working:
@smitpatel It is always true and was not a typo. I reduced the code down to its simplest possible form for testing. |
Same issue here!!! |
Hi everyone! This simple expression (and others similar ones too): calls next exception: |
This is still an issue in Preview 9. Preview 5 is the newest version I'm able to use without running into this problem. Please look into this before releasing 3.0 .. this is critical functionality This fails on preview 6, 7, 8 and 9 |
Generated SQL in 3.1 SELECT [e1].[LocalId], (
SELECT TOP(1) [e0].[Description]
FROM [EmployeesTitles] AS [e]
LEFT JOIN [EmployeeTitle] AS [e0] ON [e].[EmployeeTitleId] = [e0].[Id]
WHERE [e1].[Id] = [e].[EmployeesId]) AS [Title]
FROM [Employees] AS [e1] |
Hi. I am running into a
NotImplementedException
exception any time I attempt to pass a predicate into any linq method, if it's called from inside an expression tree. Same issue withFirstOrDefault(...)
,OrderBy(...)
,Select(...)
etc.FirstOrDefault()
with no parameters works fine.I've just updated to the latest preview6 packages and still encounter the same trouble.
Cheers
EmployeesController.cs
This works fine:
This throws
NotImplementedException
:Exception
Further technical details
VSCode 1.35.1 linux
OS: KDE Neon (Ubuntu 18.04 base)
Dabase Provider: Microsoft.EntityFrameworkCore.SqlServer
dotnet list package
dotnet --info
The text was updated successfully, but these errors were encountered: