Skip to content
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

IncludeOptimized not working with many-to-many relationship #656

Open
MaksymBondarUA opened this issue Dec 2, 2020 · 1 comment
Open
Assignees

Comments

@MaksymBondarUA
Copy link

MaksymBondarUA commented Dec 2, 2020

Hello
In our project, we using EF core (Version 5.0.0-rc.2.20475.17). When I try to get the inner collection by

players.Include(p=>p.Interests).ToList();

It works and all player entities include "Interests" collection. But when I try to get players by

players.IncludeOptimized(p=>p.Interests).ToList();

I get players with Empty interests lists.

These tables have relationship many-to-may

builder.Entity<Player>()
               .HasMany(p => p.Interests)
               .WithMany(i=>i.Players);
builder.Entity<Interest>()
                .HasMany(i => i.Players)
                .WithMany(p => p.Interests);

I did a few tests with tables with the same relationships(many-to-many) and IncludeOptimized not working

EF version: EF core (Version 5.0.0-rc.2.20475.17)
EF Plus version: 5.1.4
Database Provider: MSSQL

@JonathanMagnan JonathanMagnan self-assigned this Dec 6, 2020
@JonathanMagnan
Copy link
Member

Hello @MaksymBondarUA ,

Thank you for reporting,

We will eventually re-write this whole feature as most of it might already be included with EF Core 5.

Unfortunately, we don't have this time for now as we need first to fix some other features.

Best Regards,

Jon


Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework ExtensionsEntity Framework ClassicBulk OperationsDapper Plus

Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval FunctionSQL Eval Function

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants