-
Notifications
You must be signed in to change notification settings - Fork 231
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 generates incorrect SQL #147
Comments
@Pc-lover, this looks like a general EF Core question, i.e. not Npgsql-related. These belong in the EF Core repo rather than here. A quick look shows this is an attempt to do many-to-many. You may want to follow the guidelines in the EF Core docs. If you suspect this is an Npgsql-specific issue please post back here. |
@roji, I think this is a bug. Not sure if it belongs to EF Core or Npgsql, though. var db = new Context();
var postIds = db.PostsTags.Include(m => m.Post).Where(m => m.Tag.Name == "www").Select(m => m.PostId);
var posts = db.Posts.Where(m => postIds.Contains(m.Id)).ToList(); If I remove For example (it works fine): var db = new Context();
var postIds = db.PostsTags.Where(m => m.Tag.Name == "www").Select(m => m.PostId);
var posts = db.Posts.Where(m => postIds.Contains(m.Id)).ToList(); |
I'm using ASP.NET Core with Npgsql 3.2.0 and Npgsql.EntityFrameworkCore.PostgreSQL 1.1.0.
SQL schema:
These below codes throw exception:
SQL generated by EF (incorrect)
SQL expected:
The text was updated successfully, but these errors were encountered: