-
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
preview8 join giving not implemented #17176
Comments
Client side group join. This query cannot be translated to SQL directly. Adding AsEnumerable should be good way since it does not affect how much data is transferred from server. |
Thanks for confirming, much appreciated. Just for my understanding, this seems like a join that could be handled in the server.
|
There is no SQL equivalent of GroupJoin. |
Cheers, thanks for clearing it up, makes sense. I was thinking perhaps i could of used a navigational property instead to get around the issue. |
I wonder how would I implement a left join in EF Core 3.0? As |
@coderfox - GroupJoin-DefaultIfEmpty-SelectMany is LINQ's way of writing Left join from c in cs
join o in os on c.CustomerID equals o.CustomerID into grouping
from o in grouping.DefaultIfEmpty()
select { c, o } This generates Customers LEFT JOIN Orders in database. |
@smitpatel and that would translate obviously to client side evaluation? So you can't actually ever have a server side left join query? |
@dotnetshadow - that would translate to Select c.*, o.*
FROM Customers AS c
LEFT JOIN Orders AS o ON c.CustomerID = o.CustomerID If you write a proper equivalent of LEFT JOIN on client side, we generate a left join. Not all variations of GroupJoin-DefaultIfEmpty-SelectMany are left join. LINQ has a lot more range variables in the scope than what LEFT JOIN could allow. So if you do it incorrectly, it is client evaluation. You can have server side left join query if you write it correctly. We have 100s of test verifying that. |
Duplicate of #19930 |
When upgrading from preview5 to preview8 the following query throws
"The method or operation is not implemented."
The following query taken from:
https://github.com/KalikoCMS/KalikoCMS.NextGen/blob/netcore3.0-experimental/KalikoCMS.Legacy/Data/Repositories/LegacyContentRepository.cs#L35
It's saying that the GroupJoin can't be translated?
If I add
.AsEnumerable
to L35 then it works, because it's evaluating locallyI'm guessing the query needs to be rewritten, but not sure how it should look?
Exception message:
"The method or operation is not implemented."
Steps to reproduce
https://github.com/KalikoCMS/KalikoCMS.NextGen/tree/netcore3.0-experimental
Change the EF core 3.0 reference from preview 5 to 8 in KalioCMS.Legacy and KalikoCMS.Data.SqlServer projects
Further technical details
EF Core version: 3.0 preview8
Database Provider: Microsoft.EntityFrameworkCore.SqlServer
Operating system:
IDE: Visual Studio 2019 16.2 preview 2
The text was updated successfully, but these errors were encountered: