-
Notifications
You must be signed in to change notification settings - Fork 227
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
Left Join with where not working #990
Comments
Which version of the Npgsql.EntityFrameworkCore.PostgreSQL provider are you using? If you're using 2.2, can you please give 3.0.0-preview8 a try, as things have significantly changed there? |
That said, the query you're trying to translate seems particularly complex, so it may not be translatable (at least not at the moment). There may be ways to rewrite it in a simpler manner. |
I updated to 3.0.0-preview8 and it seems like GroupJoin is not implemented yet |
I know the query is complex, but I want the query to run in one go normally I would have written something like this context.Accounts.Where(account => account.Id == 6).SelectMany(account =>
account.Streams.Select(stream => new
{
Stream = stream,
Subsribers = context.Subscriptions.Where(subscription =>
subscription.Date > stream.StreamStart && subscription.Date < stream.StreamEnd)
})).ToList(); But this results in a query that will be evaluated locally. |
The error also ocurs with the SqlServer provider, so it isn't specific to PostgreSQL. new Issue dotnet/efcore#17382 |
I'm trying to perform a left join, but it creates a subquery in the join that doesn't work.
I created a sample project to illustrate the problem
This is my Linq query which selects all streams from an account and the subscribers during that stream
Linq query syntax
Linq extention method syntax
This is the query that gets generated
Which gives the following error
Is my approach wrong or is this a bug/limitation in Entity Framework?
The text was updated successfully, but these errors were encountered: