EntityFramework-Plus icon indicating copy to clipboard operation
EntityFramework-Plus copied to clipboard

IncludeOptimized not working with many-to-many relationship

Open MaksymBondarUA opened this issue 5 years ago • 1 comments

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

MaksymBondarUA avatar Dec 02 '20 16:12 MaksymBondarUA

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

JonathanMagnan avatar Dec 06 '20 13:12 JonathanMagnan