IncludeOptimized not working with many-to-many relationship
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
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 Extensions • Entity Framework Classic • Bulk Operations • Dapper Plus
Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function • SQL Eval Function