From ccf3fc5672ff5864493681db55113396386704a5 Mon Sep 17 00:00:00 2001 From: Smit Patel Date: Wed, 15 Sep 2021 16:51:14 -0700 Subject: [PATCH] Query: Fix temporal table tests Resolves #26047 --- .../Query/ManyToManyFieldsQueryFixtureBase.cs | 42 +-- .../Query/ManyToManyQueryFixtureBase.cs | 15 +- .../ManyToManyFieldsModel/ManyToManyData.cs | 270 +++++++++--------- .../ManyToManyModel/ManyToManyData.cs | 4 +- .../ManyToManyFieldsLoadSqlServerTest.cs | 104 +++---- .../Query/ManyToManyQuerySqlServerTest.cs | 34 +-- .../Query/TPTManyToManyQuerySqlServerTest.cs | 34 +-- ...TemporalManyToManyQuerySqlServerFixture.cs | 66 ++--- .../TemporalManyToManyQuerySqlServerTest.cs | 212 +++++++------- 9 files changed, 363 insertions(+), 418 deletions(-) diff --git a/test/EFCore.Specification.Tests/Query/ManyToManyFieldsQueryFixtureBase.cs b/test/EFCore.Specification.Tests/Query/ManyToManyFieldsQueryFixtureBase.cs index b4f11bf7dbb..87663361669 100644 --- a/test/EFCore.Specification.Tests/Query/ManyToManyFieldsQueryFixtureBase.cs +++ b/test/EFCore.Specification.Tests/Query/ManyToManyFieldsQueryFixtureBase.cs @@ -271,19 +271,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con .WithOne(e => e.ReferenceInverse) .HasForeignKey(e => e.ReferenceInverseId); - // TODO: Remove UsingEntity modelBuilder.Entity() .HasMany(e => e.TwoSkipShared) - .WithMany(e => e.OneSkipShared) - .UsingEntity>( - "EntityOneEntityTwo", - r => r.HasOne().WithMany().HasForeignKey("EntityTwoId"), - l => l.HasOne().WithMany().HasForeignKey("EntityOneId")); + .WithMany(e => e.OneSkipShared); // Nav:2 Payload:No Join:Concrete Extra:None modelBuilder.Entity() .HasMany(e => e.TwoSkip) .WithMany(e => e.OneSkip) + // See issue#25491 .UsingEntity( r => r.HasOne().WithMany().HasForeignKey(e => e.TwoId), l => l.HasOne().WithMany().HasForeignKey(e => e.OneId)); @@ -325,9 +321,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con modelBuilder.Entity() .HasMany(e => e.BranchSkip) .WithMany(e => e.OneSkip) - .UsingEntity( - r => r.HasOne().WithMany(), - l => l.HasOne().WithMany()); + .UsingEntity(); modelBuilder.Entity() .HasOne(e => e.Reference) @@ -348,25 +342,14 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con l => l.HasOne(x => x.Two).WithMany(e => e.JoinThreeFull)); // Nav:2 Payload:No Join:Shared Extra:Self-ref - // TODO: Remove UsingEntity modelBuilder.Entity() .HasMany(e => e.SelfSkipSharedLeft) - .WithMany(e => e.SelfSkipSharedRight) - .UsingEntity>( - "JoinTwoSelfShared", - l => l.HasOne().WithMany().HasForeignKey("LeftId"), - r => r.HasOne().WithMany().HasForeignKey("RightId")); + .WithMany(e => e.SelfSkipSharedRight); // Nav:2 Payload:No Join:Shared Extra:CompositeKey - // TODO: Remove UsingEntity modelBuilder.Entity() .HasMany(e => e.CompositeKeySkipShared) - .WithMany(e => e.TwoSkipShared) - .UsingEntity>( - "JoinTwoToCompositeKeyShared", - r => r.HasOne().WithMany().HasForeignKey("CompositeId1", "CompositeId2", "CompositeId3"), - l => l.HasOne().WithMany().HasForeignKey("TwoId")) - .HasKey("TwoId", "CompositeId1", "CompositeId2", "CompositeId3"); + .WithMany(e => e.TwoSkipShared); // Nav:6 Payload:No Join:Concrete Extra:CompositeKey modelBuilder.Entity() @@ -388,23 +371,12 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con }); // Nav:2 Payload:No Join:Shared Extra:Inheritance - // TODO: Remove UsingEntity - modelBuilder.Entity().HasMany(e => e.RootSkipShared).WithMany(e => e.ThreeSkipShared) - .UsingEntity>( - "EntityRootEntityThree", - r => r.HasOne().WithMany().HasForeignKey("EntityRootId"), - l => l.HasOne().WithMany().HasForeignKey("EntityThreeId")); + modelBuilder.Entity().HasMany(e => e.RootSkipShared).WithMany(e => e.ThreeSkipShared); // Nav:2 Payload:No Join:Shared Extra:Inheritance,CompositeKey - // TODO: Remove UsingEntity modelBuilder.Entity() .HasMany(e => e.RootSkipShared) - .WithMany(e => e.CompositeKeySkipShared) - .UsingEntity>( - "JoinCompositeKeyToRootShared", - r => r.HasOne().WithMany().HasForeignKey("RootId"), - l => l.HasOne().WithMany().HasForeignKey("CompositeId1", "CompositeId2", "CompositeId3")) - .HasKey("CompositeId1", "CompositeId2", "CompositeId3", "RootId"); + .WithMany(e => e.CompositeKeySkipShared); // Nav:6 Payload:No Join:Concrete Extra:Inheritance,CompositeKey modelBuilder.Entity() diff --git a/test/EFCore.Specification.Tests/Query/ManyToManyQueryFixtureBase.cs b/test/EFCore.Specification.Tests/Query/ManyToManyQueryFixtureBase.cs index 2c5f163cbc8..94f9ec5b60b 100644 --- a/test/EFCore.Specification.Tests/Query/ManyToManyQueryFixtureBase.cs +++ b/test/EFCore.Specification.Tests/Query/ManyToManyQueryFixtureBase.cs @@ -188,22 +188,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con .WithOne(e => e.ReferenceInverse) .HasForeignKey(e => e.ReferenceInverseId); - // TODO: Remove UsingEntity modelBuilder.Entity() .HasMany(e => e.TwoSkipShared) - .WithMany(e => e.OneSkipShared) - .UsingEntity>( - "EntityOneEntityTwo", - r => r.HasOne().WithMany().HasForeignKey("EntityTwoId"), - l => l.HasOne().WithMany().HasForeignKey("EntityOneId")); + .WithMany(e => e.OneSkipShared); // Nav:2 Payload:No Join:Concrete Extra:None modelBuilder.Entity() .HasMany(e => e.TwoSkip) .WithMany(e => e.OneSkip) - .UsingEntity( - r => r.HasOne(e => e.Two).WithMany().HasForeignKey(e => e.TwoId), - l => l.HasOne(e => e.One).WithMany().HasForeignKey(e => e.OneId)); + .UsingEntity(); // Nav:6 Payload:Yes Join:Concrete Extra:None modelBuilder.Entity() @@ -235,9 +228,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con modelBuilder.Entity() .HasMany(e => e.BranchSkip) .WithMany(e => e.OneSkip) - .UsingEntity( - r => r.HasOne().WithMany(), - l => l.HasOne().WithMany()); + .UsingEntity(); modelBuilder.Entity() .HasOne(e => e.Reference) diff --git a/test/EFCore.Specification.Tests/TestModels/ManyToManyFieldsModel/ManyToManyData.cs b/test/EFCore.Specification.Tests/TestModels/ManyToManyFieldsModel/ManyToManyData.cs index 5cfb4ae8ccc..347afee5130 100644 --- a/test/EFCore.Specification.Tests/TestModels/ManyToManyFieldsModel/ManyToManyData.cs +++ b/test/EFCore.Specification.Tests/TestModels/ManyToManyFieldsModel/ManyToManyData.cs @@ -43,10 +43,10 @@ public ManyToManyData(ManyToManyContext context, bool useGeneratedKeys) context.Set>("EntityOneEntityTwo").AddRange(CreateEntityOneEntityTwos(context)); context.Set>("JoinOneToThreePayloadFullShared") .AddRange(CreateJoinOneToThreePayloadFullShareds(context)); - context.Set>("JoinTwoSelfShared").AddRange(CreateJoinTwoSelfShareds(context)); - context.Set>("JoinTwoToCompositeKeyShared").AddRange(CreateJoinTwoToCompositeKeyShareds(context)); + context.Set>("EntityTwoEntityTwo").AddRange(CreateEntityTwoEntityTwos(context)); + context.Set>("EntityCompositeKeyEntityTwo").AddRange(CreateEntityCompositeKeyEntityTwos(context)); context.Set>("EntityRootEntityThree").AddRange(CreateEntityRootEntityThrees(context)); - context.Set>("JoinCompositeKeyToRootShared").AddRange(CreateJoinCompositeKeyToRootShareds(context)); + context.Set>("EntityCompositeKeyEntityRoot").AddRange(CreateEntityCompositeKeyEntityRoots(context)); } public IQueryable Set() @@ -957,8 +957,8 @@ private static Dictionary CreateEntityOneEntityTwo( return CreateInstance( context?.Set>("EntityOneEntityTwo"), (e, p) => { - e["EntityOneId"] = context?.Entry(one).Property(e => e.Id).CurrentValue ?? one.Id; - e["EntityTwoId"] = context?.Entry(two).Property(e => e.Id).CurrentValue ?? two.Id; + e["OneSkipSharedId"] = context?.Entry(one).Property(e => e.Id).CurrentValue ?? one.Id; + e["TwoSkipSharedId"] = context?.Entry(two).Property(e => e.Id).CurrentValue ?? two.Id; }); } @@ -1020,108 +1020,108 @@ private static Dictionary CreateJoinOneToThreePayloadFullShared( e["Payload"] = payload; }); - private Dictionary[] CreateJoinTwoSelfShareds(ManyToManyContext context) + private Dictionary[] CreateEntityTwoEntityTwos(ManyToManyContext context) => new[] { - CreateJoinTwoSelfShared(context, _twos[0], _twos[8]), - CreateJoinTwoSelfShared(context, _twos[0], _twos[9]), - CreateJoinTwoSelfShared(context, _twos[0], _twos[10]), - CreateJoinTwoSelfShared(context, _twos[0], _twos[17]), - CreateJoinTwoSelfShared(context, _twos[2], _twos[1]), - CreateJoinTwoSelfShared(context, _twos[2], _twos[4]), - CreateJoinTwoSelfShared(context, _twos[2], _twos[7]), - CreateJoinTwoSelfShared(context, _twos[2], _twos[17]), - CreateJoinTwoSelfShared(context, _twos[2], _twos[18]), - CreateJoinTwoSelfShared(context, _twos[3], _twos[10]), - CreateJoinTwoSelfShared(context, _twos[4], _twos[7]), - CreateJoinTwoSelfShared(context, _twos[5], _twos[17]), - CreateJoinTwoSelfShared(context, _twos[7], _twos[1]), - CreateJoinTwoSelfShared(context, _twos[7], _twos[13]), - CreateJoinTwoSelfShared(context, _twos[7], _twos[14]), - CreateJoinTwoSelfShared(context, _twos[7], _twos[19]), - CreateJoinTwoSelfShared(context, _twos[8], _twos[3]), - CreateJoinTwoSelfShared(context, _twos[8], _twos[13]), - CreateJoinTwoSelfShared(context, _twos[9], _twos[4]), - CreateJoinTwoSelfShared(context, _twos[11], _twos[12]), - CreateJoinTwoSelfShared(context, _twos[11], _twos[13]), - CreateJoinTwoSelfShared(context, _twos[12], _twos[13]), - CreateJoinTwoSelfShared(context, _twos[12], _twos[17]), - CreateJoinTwoSelfShared(context, _twos[12], _twos[18]), - CreateJoinTwoSelfShared(context, _twos[15], _twos[5]), - CreateJoinTwoSelfShared(context, _twos[16], _twos[8]), - CreateJoinTwoSelfShared(context, _twos[16], _twos[18]), - CreateJoinTwoSelfShared(context, _twos[16], _twos[19]), - CreateJoinTwoSelfShared(context, _twos[17], _twos[1]), - CreateJoinTwoSelfShared(context, _twos[17], _twos[4]), - CreateJoinTwoSelfShared(context, _twos[17], _twos[15]), - CreateJoinTwoSelfShared(context, _twos[17], _twos[16]), - CreateJoinTwoSelfShared(context, _twos[18], _twos[1]), - CreateJoinTwoSelfShared(context, _twos[19], _twos[3]) + CreateEntityTwoEntityTwo(context, _twos[0], _twos[8]), + CreateEntityTwoEntityTwo(context, _twos[0], _twos[9]), + CreateEntityTwoEntityTwo(context, _twos[0], _twos[10]), + CreateEntityTwoEntityTwo(context, _twos[0], _twos[17]), + CreateEntityTwoEntityTwo(context, _twos[2], _twos[1]), + CreateEntityTwoEntityTwo(context, _twos[2], _twos[4]), + CreateEntityTwoEntityTwo(context, _twos[2], _twos[7]), + CreateEntityTwoEntityTwo(context, _twos[2], _twos[17]), + CreateEntityTwoEntityTwo(context, _twos[2], _twos[18]), + CreateEntityTwoEntityTwo(context, _twos[3], _twos[10]), + CreateEntityTwoEntityTwo(context, _twos[4], _twos[7]), + CreateEntityTwoEntityTwo(context, _twos[5], _twos[17]), + CreateEntityTwoEntityTwo(context, _twos[7], _twos[1]), + CreateEntityTwoEntityTwo(context, _twos[7], _twos[13]), + CreateEntityTwoEntityTwo(context, _twos[7], _twos[14]), + CreateEntityTwoEntityTwo(context, _twos[7], _twos[19]), + CreateEntityTwoEntityTwo(context, _twos[8], _twos[3]), + CreateEntityTwoEntityTwo(context, _twos[8], _twos[13]), + CreateEntityTwoEntityTwo(context, _twos[9], _twos[4]), + CreateEntityTwoEntityTwo(context, _twos[11], _twos[12]), + CreateEntityTwoEntityTwo(context, _twos[11], _twos[13]), + CreateEntityTwoEntityTwo(context, _twos[12], _twos[13]), + CreateEntityTwoEntityTwo(context, _twos[12], _twos[17]), + CreateEntityTwoEntityTwo(context, _twos[12], _twos[18]), + CreateEntityTwoEntityTwo(context, _twos[15], _twos[5]), + CreateEntityTwoEntityTwo(context, _twos[16], _twos[8]), + CreateEntityTwoEntityTwo(context, _twos[16], _twos[18]), + CreateEntityTwoEntityTwo(context, _twos[16], _twos[19]), + CreateEntityTwoEntityTwo(context, _twos[17], _twos[1]), + CreateEntityTwoEntityTwo(context, _twos[17], _twos[4]), + CreateEntityTwoEntityTwo(context, _twos[17], _twos[15]), + CreateEntityTwoEntityTwo(context, _twos[17], _twos[16]), + CreateEntityTwoEntityTwo(context, _twos[18], _twos[1]), + CreateEntityTwoEntityTwo(context, _twos[19], _twos[3]) }; - private static Dictionary CreateJoinTwoSelfShared( + private static Dictionary CreateEntityTwoEntityTwo( ManyToManyContext context, EntityTwo left, EntityTwo right) => CreateInstance( - context?.Set>("JoinTwoSelfShared"), (e, p) => + context?.Set>("EntityTwoEntityTwo"), (e, p) => { - e["LeftId"] = context?.Entry(left).Property(e => e.Id).CurrentValue ?? left.Id; - e["RightId"] = context?.Entry(right).Property(e => e.Id).CurrentValue ?? right.Id; + e["SelfSkipSharedLeftId"] = context?.Entry(left).Property(e => e.Id).CurrentValue ?? left.Id; + e["SelfSkipSharedRightId"] = context?.Entry(right).Property(e => e.Id).CurrentValue ?? right.Id; }); - private Dictionary[] CreateJoinTwoToCompositeKeyShareds(ManyToManyContext context) + private Dictionary[] CreateEntityCompositeKeyEntityTwos(ManyToManyContext context) => new[] { - CreateJoinTwoToCompositeKeyShared(context, _twos[0], _compositeKeys[0]), - CreateJoinTwoToCompositeKeyShared(context, _twos[0], _compositeKeys[3]), - CreateJoinTwoToCompositeKeyShared(context, _twos[0], _compositeKeys[4]), - CreateJoinTwoToCompositeKeyShared(context, _twos[1], _compositeKeys[3]), - CreateJoinTwoToCompositeKeyShared(context, _twos[2], _compositeKeys[5]), - CreateJoinTwoToCompositeKeyShared(context, _twos[3], _compositeKeys[1]), - CreateJoinTwoToCompositeKeyShared(context, _twos[3], _compositeKeys[18]), - CreateJoinTwoToCompositeKeyShared(context, _twos[5], _compositeKeys[2]), - CreateJoinTwoToCompositeKeyShared(context, _twos[5], _compositeKeys[12]), - CreateJoinTwoToCompositeKeyShared(context, _twos[6], _compositeKeys[7]), - CreateJoinTwoToCompositeKeyShared(context, _twos[8], _compositeKeys[2]), - CreateJoinTwoToCompositeKeyShared(context, _twos[8], _compositeKeys[8]), - CreateJoinTwoToCompositeKeyShared(context, _twos[9], _compositeKeys[0]), - CreateJoinTwoToCompositeKeyShared(context, _twos[9], _compositeKeys[14]), - CreateJoinTwoToCompositeKeyShared(context, _twos[9], _compositeKeys[17]), - CreateJoinTwoToCompositeKeyShared(context, _twos[10], _compositeKeys[0]), - CreateJoinTwoToCompositeKeyShared(context, _twos[10], _compositeKeys[14]), - CreateJoinTwoToCompositeKeyShared(context, _twos[11], _compositeKeys[7]), - CreateJoinTwoToCompositeKeyShared(context, _twos[11], _compositeKeys[12]), - CreateJoinTwoToCompositeKeyShared(context, _twos[11], _compositeKeys[14]), - CreateJoinTwoToCompositeKeyShared(context, _twos[12], _compositeKeys[0]), - CreateJoinTwoToCompositeKeyShared(context, _twos[12], _compositeKeys[6]), - CreateJoinTwoToCompositeKeyShared(context, _twos[12], _compositeKeys[16]), - CreateJoinTwoToCompositeKeyShared(context, _twos[14], _compositeKeys[15]), - CreateJoinTwoToCompositeKeyShared(context, _twos[15], _compositeKeys[0]), - CreateJoinTwoToCompositeKeyShared(context, _twos[15], _compositeKeys[2]), - CreateJoinTwoToCompositeKeyShared(context, _twos[15], _compositeKeys[18]), - CreateJoinTwoToCompositeKeyShared(context, _twos[16], _compositeKeys[1]), - CreateJoinTwoToCompositeKeyShared(context, _twos[16], _compositeKeys[7]), - CreateJoinTwoToCompositeKeyShared(context, _twos[16], _compositeKeys[13]), - CreateJoinTwoToCompositeKeyShared(context, _twos[16], _compositeKeys[14]), - CreateJoinTwoToCompositeKeyShared(context, _twos[18], _compositeKeys[4]), - CreateJoinTwoToCompositeKeyShared(context, _twos[19], _compositeKeys[2]), - CreateJoinTwoToCompositeKeyShared(context, _twos[19], _compositeKeys[4]), - CreateJoinTwoToCompositeKeyShared(context, _twos[19], _compositeKeys[5]), - CreateJoinTwoToCompositeKeyShared(context, _twos[19], _compositeKeys[13]) + CreateEntityCompositeKeyEntityTwo(context, _twos[0], _compositeKeys[0]), + CreateEntityCompositeKeyEntityTwo(context, _twos[0], _compositeKeys[3]), + CreateEntityCompositeKeyEntityTwo(context, _twos[0], _compositeKeys[4]), + CreateEntityCompositeKeyEntityTwo(context, _twos[1], _compositeKeys[3]), + CreateEntityCompositeKeyEntityTwo(context, _twos[2], _compositeKeys[5]), + CreateEntityCompositeKeyEntityTwo(context, _twos[3], _compositeKeys[1]), + CreateEntityCompositeKeyEntityTwo(context, _twos[3], _compositeKeys[18]), + CreateEntityCompositeKeyEntityTwo(context, _twos[5], _compositeKeys[2]), + CreateEntityCompositeKeyEntityTwo(context, _twos[5], _compositeKeys[12]), + CreateEntityCompositeKeyEntityTwo(context, _twos[6], _compositeKeys[7]), + CreateEntityCompositeKeyEntityTwo(context, _twos[8], _compositeKeys[2]), + CreateEntityCompositeKeyEntityTwo(context, _twos[8], _compositeKeys[8]), + CreateEntityCompositeKeyEntityTwo(context, _twos[9], _compositeKeys[0]), + CreateEntityCompositeKeyEntityTwo(context, _twos[9], _compositeKeys[14]), + CreateEntityCompositeKeyEntityTwo(context, _twos[9], _compositeKeys[17]), + CreateEntityCompositeKeyEntityTwo(context, _twos[10], _compositeKeys[0]), + CreateEntityCompositeKeyEntityTwo(context, _twos[10], _compositeKeys[14]), + CreateEntityCompositeKeyEntityTwo(context, _twos[11], _compositeKeys[7]), + CreateEntityCompositeKeyEntityTwo(context, _twos[11], _compositeKeys[12]), + CreateEntityCompositeKeyEntityTwo(context, _twos[11], _compositeKeys[14]), + CreateEntityCompositeKeyEntityTwo(context, _twos[12], _compositeKeys[0]), + CreateEntityCompositeKeyEntityTwo(context, _twos[12], _compositeKeys[6]), + CreateEntityCompositeKeyEntityTwo(context, _twos[12], _compositeKeys[16]), + CreateEntityCompositeKeyEntityTwo(context, _twos[14], _compositeKeys[15]), + CreateEntityCompositeKeyEntityTwo(context, _twos[15], _compositeKeys[0]), + CreateEntityCompositeKeyEntityTwo(context, _twos[15], _compositeKeys[2]), + CreateEntityCompositeKeyEntityTwo(context, _twos[15], _compositeKeys[18]), + CreateEntityCompositeKeyEntityTwo(context, _twos[16], _compositeKeys[1]), + CreateEntityCompositeKeyEntityTwo(context, _twos[16], _compositeKeys[7]), + CreateEntityCompositeKeyEntityTwo(context, _twos[16], _compositeKeys[13]), + CreateEntityCompositeKeyEntityTwo(context, _twos[16], _compositeKeys[14]), + CreateEntityCompositeKeyEntityTwo(context, _twos[18], _compositeKeys[4]), + CreateEntityCompositeKeyEntityTwo(context, _twos[19], _compositeKeys[2]), + CreateEntityCompositeKeyEntityTwo(context, _twos[19], _compositeKeys[4]), + CreateEntityCompositeKeyEntityTwo(context, _twos[19], _compositeKeys[5]), + CreateEntityCompositeKeyEntityTwo(context, _twos[19], _compositeKeys[13]) }; - private static Dictionary CreateJoinTwoToCompositeKeyShared( + private static Dictionary CreateEntityCompositeKeyEntityTwo( ManyToManyContext context, EntityTwo two, EntityCompositeKey composite) => CreateInstance( - context?.Set>("JoinTwoToCompositeKeyShared"), (e, p) => + context?.Set>("EntityCompositeKeyEntityTwo"), (e, p) => { - e["TwoId"] = context?.Entry(two).Property(e => e.Id).CurrentValue ?? two.Id; - e["CompositeId1"] = context?.Entry(composite).Property(e => e.Key1).CurrentValue ?? composite.Key1; - e["CompositeId2"] = composite.Key2; - e["CompositeId3"] = composite.Key3; + e["TwoSkipSharedId"] = context?.Entry(two).Property(e => e.Id).CurrentValue ?? two.Id; + e["CompositeKeySkipSharedKey1"] = context?.Entry(composite).Property(e => e.Key1).CurrentValue ?? composite.Key1; + e["CompositeKeySkipSharedKey2"] = composite.Key2; + e["CompositeKeySkipSharedKey3"] = composite.Key3; }); private Dictionary[] CreateEntityRootEntityThrees(ManyToManyContext context) @@ -1165,68 +1165,68 @@ private static Dictionary CreateEntityRootEntityThree( => CreateInstance( context?.Set>("EntityRootEntityThree"), (e, p) => { - e["EntityThreeId"] = context?.Entry(three).Property(e => e.Id).CurrentValue ?? three.Id; - e["EntityRootId"] = context?.Entry(root).Property(e => e.Id).CurrentValue ?? root.Id; + e["ThreeSkipSharedId"] = context?.Entry(three).Property(e => e.Id).CurrentValue ?? three.Id; + e["RootSkipSharedId"] = context?.Entry(root).Property(e => e.Id).CurrentValue ?? root.Id; }); - private Dictionary[] CreateJoinCompositeKeyToRootShareds(ManyToManyContext context) + private Dictionary[] CreateEntityCompositeKeyEntityRoots(ManyToManyContext context) => new[] { - CreateJoinCompositeKeyToRootShared(context, _roots[5], _compositeKeys[0]), - CreateJoinCompositeKeyToRootShared(context, _roots[8], _compositeKeys[0]), - CreateJoinCompositeKeyToRootShared(context, _roots[19], _compositeKeys[0]), - CreateJoinCompositeKeyToRootShared(context, _roots[0], _compositeKeys[1]), - CreateJoinCompositeKeyToRootShared(context, _roots[1], _compositeKeys[1]), - CreateJoinCompositeKeyToRootShared(context, _roots[3], _compositeKeys[1]), - CreateJoinCompositeKeyToRootShared(context, _roots[5], _compositeKeys[1]), - CreateJoinCompositeKeyToRootShared(context, _roots[10], _compositeKeys[1]), - CreateJoinCompositeKeyToRootShared(context, _roots[17], _compositeKeys[1]), - CreateJoinCompositeKeyToRootShared(context, _roots[3], _compositeKeys[2]), - CreateJoinCompositeKeyToRootShared(context, _roots[13], _compositeKeys[2]), - CreateJoinCompositeKeyToRootShared(context, _roots[15], _compositeKeys[2]), - CreateJoinCompositeKeyToRootShared(context, _roots[1], _compositeKeys[3]), - CreateJoinCompositeKeyToRootShared(context, _roots[2], _compositeKeys[3]), - CreateJoinCompositeKeyToRootShared(context, _roots[3], _compositeKeys[3]), - CreateJoinCompositeKeyToRootShared(context, _roots[1], _compositeKeys[7]), - CreateJoinCompositeKeyToRootShared(context, _roots[7], _compositeKeys[7]), - CreateJoinCompositeKeyToRootShared(context, _roots[15], _compositeKeys[7]), - CreateJoinCompositeKeyToRootShared(context, _roots[17], _compositeKeys[7]), - CreateJoinCompositeKeyToRootShared(context, _roots[6], _compositeKeys[8]), - CreateJoinCompositeKeyToRootShared(context, _roots[7], _compositeKeys[8]), - CreateJoinCompositeKeyToRootShared(context, _roots[18], _compositeKeys[8]), - CreateJoinCompositeKeyToRootShared(context, _roots[2], _compositeKeys[9]), - CreateJoinCompositeKeyToRootShared(context, _roots[11], _compositeKeys[9]), - CreateJoinCompositeKeyToRootShared(context, _roots[17], _compositeKeys[9]), - CreateJoinCompositeKeyToRootShared(context, _roots[1], _compositeKeys[10]), - CreateJoinCompositeKeyToRootShared(context, _roots[3], _compositeKeys[10]), - CreateJoinCompositeKeyToRootShared(context, _roots[4], _compositeKeys[10]), - CreateJoinCompositeKeyToRootShared(context, _roots[6], _compositeKeys[11]), - CreateJoinCompositeKeyToRootShared(context, _roots[2], _compositeKeys[12]), - CreateJoinCompositeKeyToRootShared(context, _roots[7], _compositeKeys[12]), - CreateJoinCompositeKeyToRootShared(context, _roots[13], _compositeKeys[12]), - CreateJoinCompositeKeyToRootShared(context, _roots[3], _compositeKeys[14]), - CreateJoinCompositeKeyToRootShared(context, _roots[10], _compositeKeys[14]), - CreateJoinCompositeKeyToRootShared(context, _roots[0], _compositeKeys[15]), - CreateJoinCompositeKeyToRootShared(context, _roots[6], _compositeKeys[15]), - CreateJoinCompositeKeyToRootShared(context, _roots[14], _compositeKeys[15]), - CreateJoinCompositeKeyToRootShared(context, _roots[0], _compositeKeys[18]), - CreateJoinCompositeKeyToRootShared(context, _roots[5], _compositeKeys[19]) + CreateEntityCompositeKeyEntityRoot(context, _roots[5], _compositeKeys[0]), + CreateEntityCompositeKeyEntityRoot(context, _roots[8], _compositeKeys[0]), + CreateEntityCompositeKeyEntityRoot(context, _roots[19], _compositeKeys[0]), + CreateEntityCompositeKeyEntityRoot(context, _roots[0], _compositeKeys[1]), + CreateEntityCompositeKeyEntityRoot(context, _roots[1], _compositeKeys[1]), + CreateEntityCompositeKeyEntityRoot(context, _roots[3], _compositeKeys[1]), + CreateEntityCompositeKeyEntityRoot(context, _roots[5], _compositeKeys[1]), + CreateEntityCompositeKeyEntityRoot(context, _roots[10], _compositeKeys[1]), + CreateEntityCompositeKeyEntityRoot(context, _roots[17], _compositeKeys[1]), + CreateEntityCompositeKeyEntityRoot(context, _roots[3], _compositeKeys[2]), + CreateEntityCompositeKeyEntityRoot(context, _roots[13], _compositeKeys[2]), + CreateEntityCompositeKeyEntityRoot(context, _roots[15], _compositeKeys[2]), + CreateEntityCompositeKeyEntityRoot(context, _roots[1], _compositeKeys[3]), + CreateEntityCompositeKeyEntityRoot(context, _roots[2], _compositeKeys[3]), + CreateEntityCompositeKeyEntityRoot(context, _roots[3], _compositeKeys[3]), + CreateEntityCompositeKeyEntityRoot(context, _roots[1], _compositeKeys[7]), + CreateEntityCompositeKeyEntityRoot(context, _roots[7], _compositeKeys[7]), + CreateEntityCompositeKeyEntityRoot(context, _roots[15], _compositeKeys[7]), + CreateEntityCompositeKeyEntityRoot(context, _roots[17], _compositeKeys[7]), + CreateEntityCompositeKeyEntityRoot(context, _roots[6], _compositeKeys[8]), + CreateEntityCompositeKeyEntityRoot(context, _roots[7], _compositeKeys[8]), + CreateEntityCompositeKeyEntityRoot(context, _roots[18], _compositeKeys[8]), + CreateEntityCompositeKeyEntityRoot(context, _roots[2], _compositeKeys[9]), + CreateEntityCompositeKeyEntityRoot(context, _roots[11], _compositeKeys[9]), + CreateEntityCompositeKeyEntityRoot(context, _roots[17], _compositeKeys[9]), + CreateEntityCompositeKeyEntityRoot(context, _roots[1], _compositeKeys[10]), + CreateEntityCompositeKeyEntityRoot(context, _roots[3], _compositeKeys[10]), + CreateEntityCompositeKeyEntityRoot(context, _roots[4], _compositeKeys[10]), + CreateEntityCompositeKeyEntityRoot(context, _roots[6], _compositeKeys[11]), + CreateEntityCompositeKeyEntityRoot(context, _roots[2], _compositeKeys[12]), + CreateEntityCompositeKeyEntityRoot(context, _roots[7], _compositeKeys[12]), + CreateEntityCompositeKeyEntityRoot(context, _roots[13], _compositeKeys[12]), + CreateEntityCompositeKeyEntityRoot(context, _roots[3], _compositeKeys[14]), + CreateEntityCompositeKeyEntityRoot(context, _roots[10], _compositeKeys[14]), + CreateEntityCompositeKeyEntityRoot(context, _roots[0], _compositeKeys[15]), + CreateEntityCompositeKeyEntityRoot(context, _roots[6], _compositeKeys[15]), + CreateEntityCompositeKeyEntityRoot(context, _roots[14], _compositeKeys[15]), + CreateEntityCompositeKeyEntityRoot(context, _roots[0], _compositeKeys[18]), + CreateEntityCompositeKeyEntityRoot(context, _roots[5], _compositeKeys[19]) }; private static ICollection CreateCollection(bool proxy) => proxy ? (ICollection)new ObservableCollection() : new List(); - private static Dictionary CreateJoinCompositeKeyToRootShared( + private static Dictionary CreateEntityCompositeKeyEntityRoot( ManyToManyContext context, EntityRoot root, EntityCompositeKey composite) => CreateInstance( - context?.Set>("JoinCompositeKeyToRootShared"), (e, p) => + context?.Set>("EntityCompositeKeyEntityRoot"), (e, p) => { - e["RootId"] = context?.Entry(root).Property(e => e.Id).CurrentValue ?? root.Id; - e["CompositeId1"] = context?.Entry(composite).Property(e => e.Key1).CurrentValue ?? composite.Key1; - e["CompositeId2"] = composite.Key2; - e["CompositeId3"] = composite.Key3; + e["RootSkipSharedId"] = context?.Entry(root).Property(e => e.Id).CurrentValue ?? root.Id; + e["CompositeKeySkipSharedKey1"] = context?.Entry(composite).Property(e => e.Key1).CurrentValue ?? composite.Key1; + e["CompositeKeySkipSharedKey2"] = composite.Key2; + e["CompositeKeySkipSharedKey3"] = composite.Key3; }); private static TEntity CreateInstance(DbSet set, Action configureEntity) diff --git a/test/EFCore.Specification.Tests/TestModels/ManyToManyModel/ManyToManyData.cs b/test/EFCore.Specification.Tests/TestModels/ManyToManyModel/ManyToManyData.cs index c484568dcb7..5e36264164f 100644 --- a/test/EFCore.Specification.Tests/TestModels/ManyToManyModel/ManyToManyData.cs +++ b/test/EFCore.Specification.Tests/TestModels/ManyToManyModel/ManyToManyData.cs @@ -957,8 +957,8 @@ private static Dictionary CreateEntityOneEntityTwo( return CreateInstance( context?.Set>("EntityOneEntityTwo"), (e, p) => { - e["EntityOneId"] = context?.Entry(one).Property(e => e.Id).CurrentValue ?? one.Id; - e["EntityTwoId"] = context?.Entry(two).Property(e => e.Id).CurrentValue ?? two.Id; + e["OneSkipSharedId"] = context?.Entry(one).Property(e => e.Id).CurrentValue ?? one.Id; + e["TwoSkipSharedId"] = context?.Entry(two).Property(e => e.Id).CurrentValue ?? two.Id; }); } diff --git a/test/EFCore.SqlServer.FunctionalTests/ManyToManyFieldsLoadSqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/ManyToManyFieldsLoadSqlServerTest.cs index 7d282e5c575..dd03396d49a 100644 --- a/test/EFCore.SqlServer.FunctionalTests/ManyToManyFieldsLoadSqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/ManyToManyFieldsLoadSqlServerTest.cs @@ -50,21 +50,21 @@ public override async Task Load_collection_using_Query_with_Include_for_inverse( AssertSql( @"@__p_0='3' -SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id], [t0].[Name] +SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId], [t0].[Id], [t0].[Name] FROM [EntityOnes] AS [e] INNER JOIN ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[EntityOneId], [e0].[EntityTwoId] + SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], [e0].[TwoSkipSharedId] FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] -) AS [t] ON [e].[Id] = [t].[EntityOneId] + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] +) AS [t] ON [e].[Id] = [t].[OneSkipSharedId] LEFT JOIN ( - SELECT [e2].[EntityOneId], [e2].[EntityTwoId], [e3].[Id], [e3].[Name] + SELECT [e2].[OneSkipSharedId], [e2].[TwoSkipSharedId], [e3].[Id], [e3].[Name] FROM [EntityOneEntityTwo] AS [e2] - INNER JOIN [EntityOnes] AS [e3] ON [e2].[EntityOneId] = [e3].[Id] + INNER JOIN [EntityOnes] AS [e3] ON [e2].[OneSkipSharedId] = [e3].[Id] WHERE [e3].[Id] = @__p_0 -) AS [t0] ON [t].[Id] = [t0].[EntityTwoId] +) AS [t0] ON [t].[Id] = [t0].[TwoSkipSharedId] WHERE [e].[Id] = @__p_0 -ORDER BY [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t0].[EntityOneId], [t0].[EntityTwoId]"); +ORDER BY [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[Id], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId]"); } public override async Task Load_collection_using_Query_with_Include_for_same_collection(bool async) @@ -74,26 +74,26 @@ public override async Task Load_collection_using_Query_with_Include_for_same_col AssertSql( @"@__p_0='3' -SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id], [t0].[Name], [t0].[EntityOneId0], [t0].[EntityTwoId0], [t0].[Id0], [t0].[CollectionInverseId], [t0].[Name0], [t0].[ReferenceInverseId] +SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId], [t0].[Id], [t0].[Name], [t0].[OneSkipSharedId0], [t0].[TwoSkipSharedId0], [t0].[Id0], [t0].[CollectionInverseId], [t0].[Name0], [t0].[ReferenceInverseId] FROM [EntityOnes] AS [e] INNER JOIN ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[EntityOneId], [e0].[EntityTwoId] + SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], [e0].[TwoSkipSharedId] FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] -) AS [t] ON [e].[Id] = [t].[EntityOneId] + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] +) AS [t] ON [e].[Id] = [t].[OneSkipSharedId] LEFT JOIN ( - SELECT [e2].[EntityOneId], [e2].[EntityTwoId], [e3].[Id], [e3].[Name], [t1].[EntityOneId] AS [EntityOneId0], [t1].[EntityTwoId] AS [EntityTwoId0], [t1].[Id] AS [Id0], [t1].[CollectionInverseId], [t1].[Name] AS [Name0], [t1].[ReferenceInverseId] + SELECT [e2].[OneSkipSharedId], [e2].[TwoSkipSharedId], [e3].[Id], [e3].[Name], [t1].[OneSkipSharedId] AS [OneSkipSharedId0], [t1].[TwoSkipSharedId] AS [TwoSkipSharedId0], [t1].[Id] AS [Id0], [t1].[CollectionInverseId], [t1].[Name] AS [Name0], [t1].[ReferenceInverseId] FROM [EntityOneEntityTwo] AS [e2] - INNER JOIN [EntityOnes] AS [e3] ON [e2].[EntityOneId] = [e3].[Id] + INNER JOIN [EntityOnes] AS [e3] ON [e2].[OneSkipSharedId] = [e3].[Id] LEFT JOIN ( - SELECT [e4].[EntityOneId], [e4].[EntityTwoId], [e5].[Id], [e5].[CollectionInverseId], [e5].[Name], [e5].[ReferenceInverseId] + SELECT [e4].[OneSkipSharedId], [e4].[TwoSkipSharedId], [e5].[Id], [e5].[CollectionInverseId], [e5].[Name], [e5].[ReferenceInverseId] FROM [EntityOneEntityTwo] AS [e4] - INNER JOIN [EntityTwos] AS [e5] ON [e4].[EntityTwoId] = [e5].[Id] - ) AS [t1] ON [e3].[Id] = [t1].[EntityOneId] + INNER JOIN [EntityTwos] AS [e5] ON [e4].[TwoSkipSharedId] = [e5].[Id] + ) AS [t1] ON [e3].[Id] = [t1].[OneSkipSharedId] WHERE [e3].[Id] = @__p_0 -) AS [t0] ON [t].[Id] = [t0].[EntityTwoId] +) AS [t0] ON [t].[Id] = [t0].[TwoSkipSharedId] WHERE [e].[Id] = @__p_0 -ORDER BY [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id], [t0].[EntityOneId0], [t0].[EntityTwoId0]"); +ORDER BY [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[Id], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId], [t0].[Id], [t0].[OneSkipSharedId0], [t0].[TwoSkipSharedId0]"); } public override async Task Load_collection_using_Query_with_Include(bool async) @@ -103,26 +103,26 @@ public override async Task Load_collection_using_Query_with_Include(bool async) AssertSql( @"@__p_0='3' -SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id], [t0].[Name], [t1].[ThreeId], [t1].[TwoId], [t1].[Id], [t1].[CollectionInverseId], [t1].[Name], [t1].[ReferenceInverseId] +SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId], [t0].[Id], [t0].[Name], [t1].[ThreeId], [t1].[TwoId], [t1].[Id], [t1].[CollectionInverseId], [t1].[Name], [t1].[ReferenceInverseId] FROM [EntityOnes] AS [e] INNER JOIN ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[EntityOneId], [e0].[EntityTwoId] + SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], [e0].[TwoSkipSharedId] FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] -) AS [t] ON [e].[Id] = [t].[EntityOneId] + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] +) AS [t] ON [e].[Id] = [t].[OneSkipSharedId] LEFT JOIN ( - SELECT [e2].[EntityOneId], [e2].[EntityTwoId], [e3].[Id], [e3].[Name] + SELECT [e2].[OneSkipSharedId], [e2].[TwoSkipSharedId], [e3].[Id], [e3].[Name] FROM [EntityOneEntityTwo] AS [e2] - INNER JOIN [EntityOnes] AS [e3] ON [e2].[EntityOneId] = [e3].[Id] + INNER JOIN [EntityOnes] AS [e3] ON [e2].[OneSkipSharedId] = [e3].[Id] WHERE [e3].[Id] = @__p_0 -) AS [t0] ON [t].[Id] = [t0].[EntityTwoId] +) AS [t0] ON [t].[Id] = [t0].[TwoSkipSharedId] LEFT JOIN ( SELECT [j].[ThreeId], [j].[TwoId], [e4].[Id], [e4].[CollectionInverseId], [e4].[Name], [e4].[ReferenceInverseId] FROM [JoinTwoToThree] AS [j] INNER JOIN [EntityThrees] AS [e4] ON [j].[ThreeId] = [e4].[Id] ) AS [t1] ON [t].[Id] = [t1].[TwoId] WHERE [e].[Id] = @__p_0 -ORDER BY [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id], [t1].[ThreeId], [t1].[TwoId]"); +ORDER BY [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[Id], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId], [t0].[Id], [t1].[ThreeId], [t1].[TwoId]"); } public override async Task Load_collection_using_Query_with_filtered_Include(bool async) @@ -132,19 +132,19 @@ public override async Task Load_collection_using_Query_with_filtered_Include(boo AssertSql( @"@__p_0='3' -SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id], [t0].[Name], [t1].[ThreeId], [t1].[TwoId], [t1].[Id], [t1].[CollectionInverseId], [t1].[Name], [t1].[ReferenceInverseId] +SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId], [t0].[Id], [t0].[Name], [t1].[ThreeId], [t1].[TwoId], [t1].[Id], [t1].[CollectionInverseId], [t1].[Name], [t1].[ReferenceInverseId] FROM [EntityOnes] AS [e] INNER JOIN ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[EntityOneId], [e0].[EntityTwoId] + SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], [e0].[TwoSkipSharedId] FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] -) AS [t] ON [e].[Id] = [t].[EntityOneId] + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] +) AS [t] ON [e].[Id] = [t].[OneSkipSharedId] LEFT JOIN ( - SELECT [e2].[EntityOneId], [e2].[EntityTwoId], [e3].[Id], [e3].[Name] + SELECT [e2].[OneSkipSharedId], [e2].[TwoSkipSharedId], [e3].[Id], [e3].[Name] FROM [EntityOneEntityTwo] AS [e2] - INNER JOIN [EntityOnes] AS [e3] ON [e2].[EntityOneId] = [e3].[Id] + INNER JOIN [EntityOnes] AS [e3] ON [e2].[OneSkipSharedId] = [e3].[Id] WHERE [e3].[Id] = @__p_0 -) AS [t0] ON [t].[Id] = [t0].[EntityTwoId] +) AS [t0] ON [t].[Id] = [t0].[TwoSkipSharedId] LEFT JOIN ( SELECT [j].[ThreeId], [j].[TwoId], [e4].[Id], [e4].[CollectionInverseId], [e4].[Name], [e4].[ReferenceInverseId] FROM [JoinTwoToThree] AS [j] @@ -152,7 +152,7 @@ FROM [JoinTwoToThree] AS [j] WHERE [e4].[Id] IN (13, 11) ) AS [t1] ON [t].[Id] = [t1].[TwoId] WHERE [e].[Id] = @__p_0 -ORDER BY [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id], [t1].[ThreeId], [t1].[TwoId]"); +ORDER BY [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[Id], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId], [t0].[Id], [t1].[ThreeId], [t1].[TwoId]"); } public override async Task Load_collection_using_Query_with_filtered_Include_and_projection(bool async) @@ -165,18 +165,18 @@ public override async Task Load_collection_using_Query_with_filtered_Include_and SELECT [t].[Id], [t].[Name], ( SELECT COUNT(*) FROM [EntityOneEntityTwo] AS [e2] - INNER JOIN [EntityOnes] AS [e3] ON [e2].[EntityOneId] = [e3].[Id] - WHERE [t].[Id] = [e2].[EntityTwoId]) AS [Count1], ( + INNER JOIN [EntityOnes] AS [e3] ON [e2].[OneSkipSharedId] = [e3].[Id] + WHERE [t].[Id] = [e2].[TwoSkipSharedId]) AS [Count1], ( SELECT COUNT(*) FROM [JoinTwoToThree] AS [j] INNER JOIN [EntityThrees] AS [e4] ON [j].[ThreeId] = [e4].[Id] WHERE [t].[Id] = [j].[TwoId]) AS [Count3] FROM [EntityOnes] AS [e] INNER JOIN ( - SELECT [e1].[Id], [e1].[Name], [e0].[EntityOneId] + SELECT [e1].[Id], [e1].[Name], [e0].[OneSkipSharedId] FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] -) AS [t] ON [e].[Id] = [t].[EntityOneId] + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] +) AS [t] ON [e].[Id] = [t].[OneSkipSharedId] WHERE [e].[Id] = @__p_0 ORDER BY [t].[Id]"); } @@ -188,30 +188,30 @@ public override async Task Load_collection_using_Query_with_join(bool async) AssertSql( @"@__p_0='3' -SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t0].[Id], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id0], [t2].[EntityOneId], [t2].[EntityTwoId], [t2].[Id], [t2].[Name], [t0].[CollectionInverseId], [t0].[Name0], [t0].[ReferenceInverseId] +SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[ReferenceInverseId], [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t0].[Id], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId], [t0].[Id0], [t2].[OneSkipSharedId], [t2].[TwoSkipSharedId], [t2].[Id], [t2].[Name], [t0].[CollectionInverseId], [t0].[Name0], [t0].[ReferenceInverseId] FROM [EntityOnes] AS [e] INNER JOIN ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[EntityOneId], [e0].[EntityTwoId] + SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], [e0].[TwoSkipSharedId] FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] -) AS [t] ON [e].[Id] = [t].[EntityOneId] + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] +) AS [t] ON [e].[Id] = [t].[OneSkipSharedId] INNER JOIN ( - SELECT [e2].[Id], [t1].[Id] AS [Id0], [t1].[CollectionInverseId], [t1].[Name] AS [Name0], [t1].[ReferenceInverseId], [t1].[EntityOneId], [t1].[EntityTwoId] + SELECT [e2].[Id], [t1].[Id] AS [Id0], [t1].[CollectionInverseId], [t1].[Name] AS [Name0], [t1].[ReferenceInverseId], [t1].[OneSkipSharedId], [t1].[TwoSkipSharedId] FROM [EntityOnes] AS [e2] INNER JOIN ( - SELECT [e4].[Id], [e4].[CollectionInverseId], [e4].[Name], [e4].[ReferenceInverseId], [e3].[EntityOneId], [e3].[EntityTwoId] + SELECT [e4].[Id], [e4].[CollectionInverseId], [e4].[Name], [e4].[ReferenceInverseId], [e3].[OneSkipSharedId], [e3].[TwoSkipSharedId] FROM [EntityOneEntityTwo] AS [e3] - INNER JOIN [EntityTwos] AS [e4] ON [e3].[EntityTwoId] = [e4].[Id] - ) AS [t1] ON [e2].[Id] = [t1].[EntityOneId] + INNER JOIN [EntityTwos] AS [e4] ON [e3].[TwoSkipSharedId] = [e4].[Id] + ) AS [t1] ON [e2].[Id] = [t1].[OneSkipSharedId] ) AS [t0] ON [t].[Id] = [t0].[Id0] LEFT JOIN ( - SELECT [e5].[EntityOneId], [e5].[EntityTwoId], [e6].[Id], [e6].[Name] + SELECT [e5].[OneSkipSharedId], [e5].[TwoSkipSharedId], [e6].[Id], [e6].[Name] FROM [EntityOneEntityTwo] AS [e5] - INNER JOIN [EntityOnes] AS [e6] ON [e5].[EntityOneId] = [e6].[Id] + INNER JOIN [EntityOnes] AS [e6] ON [e5].[OneSkipSharedId] = [e6].[Id] WHERE [e6].[Id] = @__p_0 -) AS [t2] ON [t].[Id] = [t2].[EntityTwoId] +) AS [t2] ON [t].[Id] = [t2].[TwoSkipSharedId] WHERE [e].[Id] = @__p_0 -ORDER BY [e].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t0].[Id], [t0].[EntityOneId], [t0].[EntityTwoId], [t0].[Id0], [t2].[EntityOneId], [t2].[EntityTwoId]"); +ORDER BY [e].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[Id], [t0].[Id], [t0].[OneSkipSharedId], [t0].[TwoSkipSharedId], [t0].[Id0], [t2].[OneSkipSharedId], [t2].[TwoSkipSharedId]"); } protected override void ClearLog() diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs index a69c55f9d54..4989866497b 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/ManyToManyQuerySqlServerTest.cs @@ -56,8 +56,8 @@ FROM [EntityOnes] AS [e] WHERE EXISTS ( SELECT 1 FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] - WHERE ([e].[Id] = [e0].[EntityOneId]) AND ([e1].[Name] LIKE N'%B%'))"); + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] + WHERE ([e].[Id] = [e0].[OneSkipSharedId]) AND ([e1].[Name] LIKE N'%B%'))"); } public override async Task Skip_navigation_contains(bool async) @@ -238,8 +238,8 @@ public override async Task Skip_navigation_select_subquery_sum(bool async) @"SELECT ( SELECT COALESCE(SUM([e1].[Id]), 0) FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityOnes] AS [e1] ON [e0].[EntityOneId] = [e1].[Id] - WHERE [e].[Id] = [e0].[EntityTwoId]) + INNER JOIN [EntityOnes] AS [e1] ON [e0].[OneSkipSharedId] = [e1].[Id] + WHERE [e].[Id] = [e0].[TwoSkipSharedId]) FROM [EntityTwos] AS [e]"); } @@ -443,14 +443,14 @@ public override async Task Select_many_over_skip_navigation_order_by_take(bool a @"SELECT [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name], [t0].[ReferenceInverseId] FROM [EntityOnes] AS [e] INNER JOIN ( - SELECT [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[ReferenceInverseId], [t].[EntityOneId] + SELECT [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[ReferenceInverseId], [t].[OneSkipSharedId] FROM ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[EntityOneId], ROW_NUMBER() OVER(PARTITION BY [e0].[EntityOneId] ORDER BY [e1].[Id]) AS [row] + SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], ROW_NUMBER() OVER(PARTITION BY [e0].[OneSkipSharedId] ORDER BY [e1].[Id]) AS [row] FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] ) AS [t] WHERE [t].[row] <= 2 -) AS [t0] ON [e].[Id] = [t0].[EntityOneId]"); +) AS [t0] ON [e].[Id] = [t0].[OneSkipSharedId]"); } public override async Task Select_many_over_skip_navigation_order_by_skip_take(bool async) @@ -644,15 +644,15 @@ public override async Task Include_skip_navigation_and_reference(bool async) await base.Include_skip_navigation_and_reference(async); AssertSql( - @"SELECT [e].[Id], [e].[CollectionInverseId], [e].[ExtraId], [e].[Name], [e].[ReferenceInverseId], [e0].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t].[Name], [e0].[CollectionInverseId], [e0].[Name], [e0].[ReferenceInverseId] + @"SELECT [e].[Id], [e].[CollectionInverseId], [e].[ExtraId], [e].[Name], [e].[ReferenceInverseId], [e0].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[Id], [t].[Name], [e0].[CollectionInverseId], [e0].[Name], [e0].[ReferenceInverseId] FROM [EntityTwos] AS [e] LEFT JOIN [EntityThrees] AS [e0] ON [e].[Id] = [e0].[ReferenceInverseId] LEFT JOIN ( - SELECT [e1].[EntityOneId], [e1].[EntityTwoId], [e2].[Id], [e2].[Name] + SELECT [e1].[OneSkipSharedId], [e1].[TwoSkipSharedId], [e2].[Id], [e2].[Name] FROM [EntityOneEntityTwo] AS [e1] - INNER JOIN [EntityOnes] AS [e2] ON [e1].[EntityOneId] = [e2].[Id] -) AS [t] ON [e].[Id] = [t].[EntityTwoId] -ORDER BY [e].[Id], [e0].[Id], [t].[EntityOneId], [t].[EntityTwoId]"); + INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] +) AS [t] ON [e].[Id] = [t].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId]"); } public override async Task Filtered_include_skip_navigation_where(bool async) @@ -1096,14 +1096,14 @@ FROM [EntityTwos] AS [e] LEFT JOIN [EntityThrees] AS [e0] ON [e].[Id] = [e0].[ReferenceInverseId] ORDER BY [e].[Id], [e0].[Id]", // - @"SELECT [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t].[Name], [e].[Id], [e0].[Id] + @"SELECT [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[Id], [t].[Name], [e].[Id], [e0].[Id] FROM [EntityTwos] AS [e] LEFT JOIN [EntityThrees] AS [e0] ON [e].[Id] = [e0].[ReferenceInverseId] INNER JOIN ( - SELECT [e1].[EntityOneId], [e1].[EntityTwoId], [e2].[Id], [e2].[Name] + SELECT [e1].[OneSkipSharedId], [e1].[TwoSkipSharedId], [e2].[Id], [e2].[Name] FROM [EntityOneEntityTwo] AS [e1] - INNER JOIN [EntityOnes] AS [e2] ON [e1].[EntityOneId] = [e2].[Id] -) AS [t] ON [e].[Id] = [t].[EntityTwoId] + INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] +) AS [t] ON [e].[Id] = [t].[TwoSkipSharedId] ORDER BY [e].[Id], [e0].[Id]"); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TPTManyToManyQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TPTManyToManyQuerySqlServerTest.cs index aa12f125426..94a5851f7f9 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TPTManyToManyQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TPTManyToManyQuerySqlServerTest.cs @@ -56,8 +56,8 @@ FROM [EntityOnes] AS [e] WHERE EXISTS ( SELECT 1 FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] - WHERE ([e].[Id] = [e0].[EntityOneId]) AND ([e1].[Name] LIKE N'%B%'))"); + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] + WHERE ([e].[Id] = [e0].[OneSkipSharedId]) AND ([e1].[Name] LIKE N'%B%'))"); } public override async Task Skip_navigation_contains(bool async) @@ -245,8 +245,8 @@ public override async Task Skip_navigation_select_subquery_sum(bool async) @"SELECT ( SELECT COALESCE(SUM([e1].[Id]), 0) FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityOnes] AS [e1] ON [e0].[EntityOneId] = [e1].[Id] - WHERE [e].[Id] = [e0].[EntityTwoId]) + INNER JOIN [EntityOnes] AS [e1] ON [e0].[OneSkipSharedId] = [e1].[Id] + WHERE [e].[Id] = [e0].[TwoSkipSharedId]) FROM [EntityTwos] AS [e]"); } @@ -459,14 +459,14 @@ public override async Task Select_many_over_skip_navigation_order_by_take(bool a @"SELECT [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name], [t0].[ReferenceInverseId] FROM [EntityOnes] AS [e] INNER JOIN ( - SELECT [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[ReferenceInverseId], [t].[EntityOneId] + SELECT [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[ReferenceInverseId], [t].[OneSkipSharedId] FROM ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[EntityOneId], ROW_NUMBER() OVER(PARTITION BY [e0].[EntityOneId] ORDER BY [e1].[Id]) AS [row] + SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], ROW_NUMBER() OVER(PARTITION BY [e0].[OneSkipSharedId] ORDER BY [e1].[Id]) AS [row] FROM [EntityOneEntityTwo] AS [e0] - INNER JOIN [EntityTwos] AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] + INNER JOIN [EntityTwos] AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] ) AS [t] WHERE [t].[row] <= 2 -) AS [t0] ON [e].[Id] = [t0].[EntityOneId]"); +) AS [t0] ON [e].[Id] = [t0].[OneSkipSharedId]"); } public override async Task Select_many_over_skip_navigation_order_by_skip_take(bool async) @@ -680,15 +680,15 @@ public override async Task Include_skip_navigation_and_reference(bool async) await base.Include_skip_navigation_and_reference(async); AssertSql( - @"SELECT [e].[Id], [e].[CollectionInverseId], [e].[ExtraId], [e].[Name], [e].[ReferenceInverseId], [e0].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t].[Name], [e0].[CollectionInverseId], [e0].[Name], [e0].[ReferenceInverseId] + @"SELECT [e].[Id], [e].[CollectionInverseId], [e].[ExtraId], [e].[Name], [e].[ReferenceInverseId], [e0].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[Id], [t].[Name], [e0].[CollectionInverseId], [e0].[Name], [e0].[ReferenceInverseId] FROM [EntityTwos] AS [e] LEFT JOIN [EntityThrees] AS [e0] ON [e].[Id] = [e0].[ReferenceInverseId] LEFT JOIN ( - SELECT [e1].[EntityOneId], [e1].[EntityTwoId], [e2].[Id], [e2].[Name] + SELECT [e1].[OneSkipSharedId], [e1].[TwoSkipSharedId], [e2].[Id], [e2].[Name] FROM [EntityOneEntityTwo] AS [e1] - INNER JOIN [EntityOnes] AS [e2] ON [e1].[EntityOneId] = [e2].[Id] -) AS [t] ON [e].[Id] = [t].[EntityTwoId] -ORDER BY [e].[Id], [e0].[Id], [t].[EntityOneId], [t].[EntityTwoId]"); + INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] +) AS [t] ON [e].[Id] = [t].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId]"); } public override async Task Filtered_include_skip_navigation_where(bool async) @@ -1157,14 +1157,14 @@ FROM [EntityTwos] AS [e] LEFT JOIN [EntityThrees] AS [e0] ON [e].[Id] = [e0].[ReferenceInverseId] ORDER BY [e].[Id], [e0].[Id]", // - @"SELECT [t].[EntityOneId], [t].[EntityTwoId], [t].[Id], [t].[Name], [e].[Id], [e0].[Id] + @"SELECT [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[Id], [t].[Name], [e].[Id], [e0].[Id] FROM [EntityTwos] AS [e] LEFT JOIN [EntityThrees] AS [e0] ON [e].[Id] = [e0].[ReferenceInverseId] INNER JOIN ( - SELECT [e1].[EntityOneId], [e1].[EntityTwoId], [e2].[Id], [e2].[Name] + SELECT [e1].[OneSkipSharedId], [e1].[TwoSkipSharedId], [e2].[Id], [e2].[Name] FROM [EntityOneEntityTwo] AS [e1] - INNER JOIN [EntityOnes] AS [e2] ON [e1].[EntityOneId] = [e2].[Id] -) AS [t] ON [e].[Id] = [t].[EntityTwoId] + INNER JOIN [EntityOnes] AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] +) AS [t] ON [e].[Id] = [t].[TwoSkipSharedId] ORDER BY [e].[Id], [e0].[Id]"); } diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerFixture.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerFixture.cs index 54a7a73bd84..16ad196ec8d 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerFixture.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerFixture.cs @@ -53,22 +53,17 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con .WithOne(e => e.ReferenceInverse) .HasForeignKey(e => e.ReferenceInverseId); - // TODO: Remove UsingEntity modelBuilder.Entity() .HasMany(e => e.TwoSkipShared) .WithMany(e => e.OneSkipShared) - .UsingEntity>( - "EntityOneEntityTwo", - r => r.HasOne().WithMany().HasForeignKey("EntityTwoId"), - l => l.HasOne().WithMany().HasForeignKey("EntityOneId")).ToTable(tb => tb.IsTemporal()); + .UsingEntity(t => t.ToTable(tb => tb.IsTemporal())); // Nav:2 Payload:No Join:Concrete Extra:None modelBuilder.Entity() .HasMany(e => e.TwoSkip) .WithMany(e => e.OneSkip) - .UsingEntity( - r => r.HasOne(e => e.Two).WithMany().HasForeignKey(e => e.TwoId), - l => l.HasOne(e => e.One).WithMany().HasForeignKey(e => e.OneId)).ToTable(tb => tb.IsTemporal()); + .UsingEntity() + .ToTable(tb => tb.IsTemporal()); // Nav:6 Payload:Yes Join:Concrete Extra:None modelBuilder.Entity() @@ -76,7 +71,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con .WithMany(e => e.OneSkipPayloadFull) .UsingEntity( r => r.HasOne(x => x.Three).WithMany(e => e.JoinOnePayloadFull), - l => l.HasOne(x => x.One).WithMany(e => e.JoinThreePayloadFull)).ToTable(tb => tb.IsTemporal()); + l => l.HasOne(x => x.One).WithMany(e => e.JoinThreePayloadFull)) + .ToTable(tb => tb.IsTemporal()); // Nav:4 Payload:Yes Join:Shared Extra:None modelBuilder.Entity() @@ -85,7 +81,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con .UsingEntity>( "JoinOneToThreePayloadFullShared", r => r.HasOne().WithMany(e => e.JoinOnePayloadFullShared).HasForeignKey("ThreeId"), - l => l.HasOne().WithMany(e => e.JoinThreePayloadFullShared).HasForeignKey("OneId")).ToTable(tb => tb.IsTemporal()) + l => l.HasOne().WithMany(e => e.JoinThreePayloadFullShared).HasForeignKey("OneId")) + .ToTable(tb => tb.IsTemporal()) .IndexerProperty("Payload"); // Nav:6 Payload:Yes Join:Concrete Extra:Self-Ref @@ -94,15 +91,15 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con .WithMany(e => e.SelfSkipPayloadRight) .UsingEntity( l => l.HasOne(x => x.Left).WithMany(x => x.JoinSelfPayloadLeft), - r => r.HasOne(x => x.Right).WithMany(x => x.JoinSelfPayloadRight)).ToTable(tb => tb.IsTemporal()); + r => r.HasOne(x => x.Right).WithMany(x => x.JoinSelfPayloadRight)) + .ToTable(tb => tb.IsTemporal()); // Nav:2 Payload:No Join:Concrete Extra:Inheritance modelBuilder.Entity() .HasMany(e => e.BranchSkip) .WithMany(e => e.OneSkip) - .UsingEntity( - r => r.HasOne().WithMany(), - l => l.HasOne().WithMany()).ToTable(tb => tb.IsTemporal()); + .UsingEntity() + .ToTable(tb => tb.IsTemporal()); modelBuilder.Entity() .HasOne(e => e.Reference) @@ -120,28 +117,20 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con .WithMany(e => e.TwoSkipFull) .UsingEntity( r => r.HasOne(x => x.Three).WithMany(e => e.JoinTwoFull), - l => l.HasOne(x => x.Two).WithMany(e => e.JoinThreeFull)).ToTable(tb => tb.IsTemporal()); + l => l.HasOne(x => x.Two).WithMany(e => e.JoinThreeFull)) + .ToTable(tb => tb.IsTemporal()); // Nav:2 Payload:No Join:Shared Extra:Self-ref - // TODO: Remove UsingEntity modelBuilder.Entity() .HasMany(e => e.SelfSkipSharedLeft) .WithMany(e => e.SelfSkipSharedRight) - .UsingEntity>( - "JoinTwoSelfShared", - l => l.HasOne().WithMany().HasForeignKey("LeftId"), - r => r.HasOne().WithMany().HasForeignKey("RightId")).ToTable(tb => tb.IsTemporal()); + .UsingEntity(t => t.ToTable(tb => tb.IsTemporal())); // Nav:2 Payload:No Join:Shared Extra:CompositeKey - // TODO: Remove UsingEntity modelBuilder.Entity() .HasMany(e => e.CompositeKeySkipShared) .WithMany(e => e.TwoSkipShared) - .UsingEntity>( - "JoinTwoToCompositeKeyShared", - r => r.HasOne().WithMany().HasForeignKey("CompositeId1", "CompositeId2", "CompositeId3"), - l => l.HasOne().WithMany().HasForeignKey("TwoId")).ToTable(tb => tb.IsTemporal()) - .HasKey("TwoId", "CompositeId1", "CompositeId2", "CompositeId3"); + .UsingEntity(t => t.ToTable(tb => tb.IsTemporal())); // Nav:6 Payload:No Join:Concrete Extra:CompositeKey modelBuilder.Entity() @@ -155,26 +144,18 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con e.CompositeId2, e.CompositeId3 }).IsRequired(), - r => r.HasOne(x => x.Three).WithMany(x => x.JoinCompositeKeyFull).IsRequired()).ToTable(tb => tb.IsTemporal()); + r => r.HasOne(x => x.Three).WithMany(x => x.JoinCompositeKeyFull).IsRequired()) + .ToTable(tb => tb.IsTemporal()); // Nav:2 Payload:No Join:Shared Extra:Inheritance - // TODO: Remove UsingEntity modelBuilder.Entity().HasMany(e => e.RootSkipShared).WithMany(e => e.ThreeSkipShared) - .UsingEntity>( - "EntityRootEntityThree", - r => r.HasOne().WithMany().HasForeignKey("EntityRootId"), - l => l.HasOne().WithMany().HasForeignKey("EntityThreeId")).ToTable(tb => tb.IsTemporal()); + .UsingEntity(t => t.ToTable(tb => tb.IsTemporal())); // Nav:2 Payload:No Join:Shared Extra:Inheritance,CompositeKey - // TODO: Remove UsingEntity modelBuilder.Entity() .HasMany(e => e.RootSkipShared) .WithMany(e => e.CompositeKeySkipShared) - .UsingEntity>( - "JoinCompositeKeyToRootShared", - r => r.HasOne().WithMany().HasForeignKey("RootId"), - l => l.HasOne().WithMany().HasForeignKey("CompositeId1", "CompositeId2", "CompositeId3")).ToTable(tb => tb.IsTemporal()) - .HasKey("CompositeId1", "CompositeId2", "CompositeId3", "RootId"); + .UsingEntity(t => t.ToTable(tb => tb.IsTemporal())); // Nav:6 Payload:No Join:Concrete Extra:Inheritance,CompositeKey modelBuilder.Entity() @@ -188,7 +169,8 @@ protected override void OnModelCreating(ModelBuilder modelBuilder, DbContext con e.CompositeId1, e.CompositeId2, e.CompositeId3 - })).ToTable(tb => tb.IsTemporal()) + })) + .ToTable(tb => tb.IsTemporal()) .HasKey( e => new { @@ -230,15 +212,15 @@ protected override void Seed(ManyToManyContext context) ("EntityRootEntityThree", "EntityRootEntityThreeHistory"), ("JoinCompositeKeyToLeaf", "JoinCompositeKeyToLeafHistory"), - ("JoinCompositeKeyToRootShared", "JoinCompositeKeyToRootSharedHistory"), + ("EntityCompositeKeyEntityRoot", "EntityCompositeKeyEntityRootHistory"), ("JoinOneSelfPayload", "JoinOneSelfPayloadHistory"), ("JoinOneToBranch", "JoinOneToBranchHistory"), ("JoinOneToThreePayloadFull", "JoinOneToThreePayloadFullHistory"), ("JoinOneToThreePayloadFullShared", "JoinOneToThreePayloadFullSharedHistory"), ("JoinOneToTwo", "JoinOneToTwoHistory"), ("JoinThreeToCompositeKeyFull", "JoinThreeToCompositeKeyFullHistory"), - ("JoinTwoSelfShared", "JoinTwoSelfSharedHistory"), - ("JoinTwoToCompositeKeyShared", "JoinTwoToCompositeKeySharedHistory"), + ("EntityTwoEntityTwo", "EntityTwoEntityTwoHistory"), + ("EntityCompositeKeyEntityTwo", "EntityCompositeKeyEntityTwoHistory"), ("JoinTwoToThree", "JoinTwoToThreeHistory"), }; diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs index 1f3e687dad4..70ac842061e 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/TemporalManyToManyQuerySqlServerTest.cs @@ -78,8 +78,8 @@ public override async Task Skip_navigation_any_with_predicate(bool async) WHERE EXISTS ( SELECT 1 FROM [EntityOneEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] - INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] - WHERE ([e].[Id] = [e0].[EntityOneId]) AND ([e1].[Name] LIKE N'%B%'))"); + INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] + WHERE ([e].[Id] = [e0].[OneSkipSharedId]) AND ([e1].[Name] LIKE N'%B%'))"); } public override async Task Skip_navigation_contains(bool async) @@ -151,9 +151,9 @@ public override async Task Skip_navigation_long_count_with_predicate(bool async) FROM [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] ORDER BY ( SELECT COUNT_BIG(*) - FROM [JoinTwoSelfShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[LeftId] = [e0].[Id] - WHERE ([e].[Id] = [j].[RightId]) AND ([e0].[Name] IS NOT NULL AND ([e0].[Name] LIKE N'L%'))) DESC, [e].[Id]"); + FROM [EntityTwoEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] + INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[SelfSkipSharedLeftId] = [e1].[Id] + WHERE ([e].[Id] = [e0].[SelfSkipSharedRightId]) AND ([e1].[Name] IS NOT NULL AND ([e1].[Name] LIKE N'L%'))) DESC, [e].[Id]"); } public override async Task Skip_navigation_select_many_average(bool async) @@ -164,10 +164,10 @@ public override async Task Skip_navigation_select_many_average(bool async) @"SELECT AVG(CAST([t].[Key1] AS float)) FROM [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] INNER JOIN ( - SELECT [e0].[Key1], [j].[TwoId] - FROM [JoinTwoToCompositeKeyShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON (([j].[CompositeId1] = [e0].[Key1]) AND ([j].[CompositeId2] = [e0].[Key2])) AND ([j].[CompositeId3] = [e0].[Key3]) -) AS [t] ON [e].[Id] = [t].[TwoId]"); + SELECT [e1].[Key1], [e0].[TwoSkipSharedId] + FROM [EntityCompositeKeyEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] + INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON (([e0].[CompositeKeySkipSharedKey1] = [e1].[Key1]) AND ([e0].[CompositeKeySkipSharedKey2] = [e1].[Key2])) AND ([e0].[CompositeKeySkipSharedKey3] = [e1].[Key3]) +) AS [t] ON [e].[Id] = [t].[TwoSkipSharedId]"); } public override async Task Skip_navigation_select_many_max(bool async) @@ -192,10 +192,10 @@ public override async Task Skip_navigation_select_many_min(bool async) @"SELECT MIN([t].[Id]) FROM [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] INNER JOIN ( - SELECT [e1].[Id], [e0].[EntityThreeId] + SELECT [e1].[Id], [e0].[ThreeSkipSharedId] FROM [EntityRootEntityThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] - INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[EntityRootId] = [e1].[Id] -) AS [t] ON [e].[Id] = [t].[EntityThreeId]"); + INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] +) AS [t] ON [e].[Id] = [t].[ThreeSkipSharedId]"); } public override async Task Skip_navigation_select_many_sum(bool async) @@ -206,10 +206,10 @@ public override async Task Skip_navigation_select_many_sum(bool async) @"SELECT COALESCE(SUM([t].[Key1]), 0) FROM [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] INNER JOIN ( - SELECT [e0].[Key1], [j].[RootId] - FROM [JoinCompositeKeyToRootShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON (([j].[CompositeId1] = [e0].[Key1]) AND ([j].[CompositeId2] = [e0].[Key2])) AND ([j].[CompositeId3] = [e0].[Key3]) -) AS [t] ON [e].[Id] = [t].[RootId]"); + SELECT [e1].[Key1], [e0].[RootSkipSharedId] + FROM [EntityCompositeKeyEntityRoot] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] + INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON (([e0].[CompositeKeySkipSharedKey1] = [e1].[Key1]) AND ([e0].[CompositeKeySkipSharedKey2] = [e1].[Key2])) AND ([e0].[CompositeKeySkipSharedKey3] = [e1].[Key3]) +) AS [t] ON [e].[Id] = [t].[RootSkipSharedId]"); } public override async Task Skip_navigation_select_subquery_average(bool async) @@ -260,8 +260,8 @@ public override async Task Skip_navigation_select_subquery_sum(bool async) @"SELECT ( SELECT COALESCE(SUM([e1].[Id]), 0) FROM [EntityOneEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] - INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[EntityOneId] = [e1].[Id] - WHERE [e].[Id] = [e0].[EntityTwoId]) + INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[OneSkipSharedId] = [e1].[Id] + WHERE [e].[Id] = [e0].[TwoSkipSharedId]) FROM [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e]"); } @@ -364,15 +364,15 @@ public override async Task Skip_navigation_of_type(bool async) await base.Skip_navigation_of_type(async); AssertSql( - @"SELECT [e].[Key1], [e].[Key2], [e].[Key3], [t].[Id], [t].[Discriminator], [t].[Name], [t].[PeriodEnd], [t].[PeriodStart], [t].[Number], [t].[IsGreen], [t].[CompositeId1], [t].[CompositeId2], [t].[CompositeId3], [t].[RootId] + @"SELECT [e].[Key1], [e].[Key2], [e].[Key3], [t].[Id], [t].[Discriminator], [t].[Name], [t].[PeriodEnd], [t].[PeriodStart], [t].[Number], [t].[IsGreen], [t].[RootSkipSharedId], [t].[CompositeKeySkipSharedKey1], [t].[CompositeKeySkipSharedKey2], [t].[CompositeKeySkipSharedKey3] FROM [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN ( - SELECT [e0].[Id], [e0].[Discriminator], [e0].[Name], [e0].[PeriodEnd], [e0].[PeriodStart], [e0].[Number], [e0].[IsGreen], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [j].[RootId] - FROM [JoinCompositeKeyToRootShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[RootId] = [e0].[Id] - WHERE [e0].[Discriminator] = N'EntityLeaf' -) AS [t] ON (([e].[Key1] = [t].[CompositeId1]) AND ([e].[Key2] = [t].[CompositeId2])) AND ([e].[Key3] = [t].[CompositeId3]) -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [t].[CompositeId1], [t].[CompositeId2], [t].[CompositeId3], [t].[RootId]"); + SELECT [e1].[Id], [e1].[Discriminator], [e1].[Name], [e1].[PeriodEnd], [e1].[PeriodStart], [e1].[Number], [e1].[IsGreen], [e0].[RootSkipSharedId], [e0].[CompositeKeySkipSharedKey1], [e0].[CompositeKeySkipSharedKey2], [e0].[CompositeKeySkipSharedKey3] + FROM [EntityCompositeKeyEntityRoot] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] + INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] + WHERE [e1].[Discriminator] = N'EntityLeaf' +) AS [t] ON (([e].[Key1] = [t].[CompositeKeySkipSharedKey1]) AND ([e].[Key2] = [t].[CompositeKeySkipSharedKey2])) AND ([e].[Key3] = [t].[CompositeKeySkipSharedKey3]) +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [t].[RootSkipSharedId], [t].[CompositeKeySkipSharedKey1], [t].[CompositeKeySkipSharedKey2], [t].[CompositeKeySkipSharedKey3]"); } public override async Task Join_with_skip_navigation(bool async) @@ -383,11 +383,11 @@ public override async Task Join_with_skip_navigation(bool async) @"SELECT [e].[Id], [e].[CollectionInverseId], [e].[ExtraId], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[ReferenceInverseId], [e0].[Id], [e0].[CollectionInverseId], [e0].[ExtraId], [e0].[Name], [e0].[PeriodEnd], [e0].[PeriodStart], [e0].[ReferenceInverseId] FROM [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [e].[Id] = ( - SELECT TOP(1) [e1].[Id] - FROM [JoinTwoSelfShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [j].[RightId] = [e1].[Id] - WHERE [e0].[Id] = [j].[LeftId] - ORDER BY [e1].[Id])"); + SELECT TOP(1) [e2].[Id] + FROM [EntityTwoEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] + INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [e1].[SelfSkipSharedRightId] = [e2].[Id] + WHERE [e0].[Id] = [e1].[SelfSkipSharedLeftId] + ORDER BY [e2].[Id])"); } public override async Task Left_join_with_skip_navigation(bool async) @@ -398,16 +398,16 @@ public override async Task Left_join_with_skip_navigation(bool async) @"SELECT [e].[Key1], [e].[Key2], [e].[Key3], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e0].[Key1], [e0].[Key2], [e0].[Key3], [e0].[Name], [e0].[PeriodEnd], [e0].[PeriodStart] FROM [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON ( - SELECT TOP(1) [e1].[Id] - FROM [JoinTwoToCompositeKeyShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [j].[TwoId] = [e1].[Id] - WHERE (([e].[Key1] = [j].[CompositeId1]) AND ([e].[Key2] = [j].[CompositeId2])) AND ([e].[Key3] = [j].[CompositeId3]) - ORDER BY [e1].[Id]) = ( SELECT TOP(1) [e2].[Id] - FROM [JoinThreeToCompositeKeyFull] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j0] - INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [j0].[ThreeId] = [e2].[Id] - WHERE (([e0].[Key1] = [j0].[CompositeId1]) AND ([e0].[Key2] = [j0].[CompositeId2])) AND ([e0].[Key3] = [j0].[CompositeId3]) - ORDER BY [e2].[Id]) + FROM [EntityCompositeKeyEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] + INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [e1].[TwoSkipSharedId] = [e2].[Id] + WHERE (([e].[Key1] = [e1].[CompositeKeySkipSharedKey1]) AND ([e].[Key2] = [e1].[CompositeKeySkipSharedKey2])) AND ([e].[Key3] = [e1].[CompositeKeySkipSharedKey3]) + ORDER BY [e2].[Id]) = ( + SELECT TOP(1) [e3].[Id] + FROM [JoinThreeToCompositeKeyFull] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] + INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e3] ON [j].[ThreeId] = [e3].[Id] + WHERE (([e0].[Key1] = [j].[CompositeId1]) AND ([e0].[Key2] = [j].[CompositeId2])) AND ([e0].[Key3] = [j].[CompositeId3]) + ORDER BY [e3].[Id]) ORDER BY [e].[Key1], [e0].[Key1], [e].[Key2], [e0].[Key2]"); } @@ -419,10 +419,10 @@ public override async Task Select_many_over_skip_navigation(bool async) @"SELECT [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[PeriodEnd], [t].[PeriodStart], [t].[ReferenceInverseId] FROM [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] INNER JOIN ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[PeriodEnd], [e1].[PeriodStart], [e1].[ReferenceInverseId], [e0].[EntityRootId] + SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[PeriodEnd], [e1].[PeriodStart], [e1].[ReferenceInverseId], [e0].[RootSkipSharedId] FROM [EntityRootEntityThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] - INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[EntityThreeId] = [e1].[Id] -) AS [t] ON [e].[Id] = [t].[EntityRootId]"); + INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[ThreeSkipSharedId] = [e1].[Id] +) AS [t] ON [e].[Id] = [t].[RootSkipSharedId]"); } public override async Task Select_many_over_skip_navigation_where(bool async) @@ -465,14 +465,14 @@ public override async Task Select_many_over_skip_navigation_order_by_take(bool a @"SELECT [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[ReferenceInverseId] FROM [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] INNER JOIN ( - SELECT [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[PeriodEnd], [t].[PeriodStart], [t].[ReferenceInverseId], [t].[EntityOneId] + SELECT [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[PeriodEnd], [t].[PeriodStart], [t].[ReferenceInverseId], [t].[OneSkipSharedId] FROM ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[PeriodEnd], [e1].[PeriodStart], [e1].[ReferenceInverseId], [e0].[EntityOneId], ROW_NUMBER() OVER(PARTITION BY [e0].[EntityOneId] ORDER BY [e1].[Id]) AS [row] + SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[PeriodEnd], [e1].[PeriodStart], [e1].[ReferenceInverseId], [e0].[OneSkipSharedId], ROW_NUMBER() OVER(PARTITION BY [e0].[OneSkipSharedId] ORDER BY [e1].[Id]) AS [row] FROM [EntityOneEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] - INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[EntityTwoId] = [e1].[Id] + INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] ) AS [t] WHERE [t].[row] <= 2 -) AS [t0] ON [e].[Id] = [t0].[EntityOneId]"); +) AS [t0] ON [e].[Id] = [t0].[OneSkipSharedId]"); } public override async Task Select_many_over_skip_navigation_order_by_skip_take(bool async) @@ -501,11 +501,11 @@ public override async Task Select_many_over_skip_navigation_of_type(bool async) @"SELECT [t].[Id], [t].[Discriminator], [t].[Name], [t].[PeriodEnd], [t].[PeriodStart], [t].[Number], [t].[IsGreen] FROM [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] INNER JOIN ( - SELECT [e1].[Id], [e1].[Discriminator], [e1].[Name], [e1].[PeriodEnd], [e1].[PeriodStart], [e1].[Number], [e1].[IsGreen], [e0].[EntityThreeId] + SELECT [e1].[Id], [e1].[Discriminator], [e1].[Name], [e1].[PeriodEnd], [e1].[PeriodStart], [e1].[Number], [e1].[IsGreen], [e0].[ThreeSkipSharedId] FROM [EntityRootEntityThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] - INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[EntityRootId] = [e1].[Id] + INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] WHERE [e1].[Discriminator] IN (N'EntityBranch', N'EntityLeaf') -) AS [t] ON [e].[Id] = [t].[EntityThreeId]"); +) AS [t] ON [e].[Id] = [t].[ThreeSkipSharedId]"); } public override async Task Select_many_over_skip_navigation_cast(bool async) @@ -546,7 +546,7 @@ public override async Task Select_skip_navigation_multiple(bool async) await base.Select_skip_navigation_multiple(async); AssertSql( - @"SELECT [e].[Id], [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[PeriodEnd], [t].[PeriodStart], [t].[ReferenceInverseId], [t].[ThreeId], [t].[TwoId], [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[ReferenceInverseId], [t0].[LeftId], [t0].[RightId], [t1].[Key1], [t1].[Key2], [t1].[Key3], [t1].[Name], [t1].[PeriodEnd], [t1].[PeriodStart], [t1].[TwoId], [t1].[CompositeId1], [t1].[CompositeId2], [t1].[CompositeId3] + @"SELECT [e].[Id], [t].[Id], [t].[CollectionInverseId], [t].[Name], [t].[PeriodEnd], [t].[PeriodStart], [t].[ReferenceInverseId], [t].[ThreeId], [t].[TwoId], [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[ReferenceInverseId], [t0].[SelfSkipSharedLeftId], [t0].[SelfSkipSharedRightId], [t1].[Key1], [t1].[Key2], [t1].[Key3], [t1].[Name], [t1].[PeriodEnd], [t1].[PeriodStart], [t1].[TwoSkipSharedId], [t1].[CompositeKeySkipSharedKey1], [t1].[CompositeKeySkipSharedKey2], [t1].[CompositeKeySkipSharedKey3] FROM [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN ( SELECT [e0].[Id], [e0].[CollectionInverseId], [e0].[Name], [e0].[PeriodEnd], [e0].[PeriodStart], [e0].[ReferenceInverseId], [j].[ThreeId], [j].[TwoId] @@ -554,16 +554,16 @@ LEFT JOIN ( INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[ThreeId] = [e0].[Id] ) AS [t] ON [e].[Id] = [t].[TwoId] LEFT JOIN ( - SELECT [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[PeriodEnd], [e1].[PeriodStart], [e1].[ReferenceInverseId], [j0].[LeftId], [j0].[RightId] - FROM [JoinTwoSelfShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j0] - INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [j0].[LeftId] = [e1].[Id] -) AS [t0] ON [e].[Id] = [t0].[RightId] + SELECT [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[PeriodEnd], [e2].[PeriodStart], [e2].[ReferenceInverseId], [e1].[SelfSkipSharedLeftId], [e1].[SelfSkipSharedRightId] + FROM [EntityTwoEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] + INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [e1].[SelfSkipSharedLeftId] = [e2].[Id] +) AS [t0] ON [e].[Id] = [t0].[SelfSkipSharedRightId] LEFT JOIN ( - SELECT [e2].[Key1], [e2].[Key2], [e2].[Key3], [e2].[Name], [e2].[PeriodEnd], [e2].[PeriodStart], [j1].[TwoId], [j1].[CompositeId1], [j1].[CompositeId2], [j1].[CompositeId3] - FROM [JoinTwoToCompositeKeyShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j1] - INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON (([j1].[CompositeId1] = [e2].[Key1]) AND ([j1].[CompositeId2] = [e2].[Key2])) AND ([j1].[CompositeId3] = [e2].[Key3]) -) AS [t1] ON [e].[Id] = [t1].[TwoId] -ORDER BY [e].[Id], [t].[ThreeId], [t].[TwoId], [t].[Id], [t0].[LeftId], [t0].[RightId], [t0].[Id], [t1].[TwoId], [t1].[CompositeId1], [t1].[CompositeId2], [t1].[CompositeId3], [t1].[Key1], [t1].[Key2]"); + SELECT [e4].[Key1], [e4].[Key2], [e4].[Key3], [e4].[Name], [e4].[PeriodEnd], [e4].[PeriodStart], [e3].[TwoSkipSharedId], [e3].[CompositeKeySkipSharedKey1], [e3].[CompositeKeySkipSharedKey2], [e3].[CompositeKeySkipSharedKey3] + FROM [EntityCompositeKeyEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e3] + INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e4] ON (([e3].[CompositeKeySkipSharedKey1] = [e4].[Key1]) AND ([e3].[CompositeKeySkipSharedKey2] = [e4].[Key2])) AND ([e3].[CompositeKeySkipSharedKey3] = [e4].[Key3]) +) AS [t1] ON [e].[Id] = [t1].[TwoSkipSharedId] +ORDER BY [e].[Id], [t].[ThreeId], [t].[TwoId], [t].[Id], [t0].[SelfSkipSharedLeftId], [t0].[SelfSkipSharedRightId], [t0].[Id], [t1].[TwoSkipSharedId], [t1].[CompositeKeySkipSharedKey1], [t1].[CompositeKeySkipSharedKey2], [t1].[CompositeKeySkipSharedKey3], [t1].[Key1], [t1].[Key2]"); } public override async Task Select_skip_navigation_first_or_default(bool async) @@ -590,14 +590,14 @@ public override async Task Include_skip_navigation(bool async) await base.Include_skip_navigation(async); AssertSql( - @"SELECT [e].[Key1], [e].[Key2], [e].[Key3], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [t].[CompositeId1], [t].[CompositeId2], [t].[CompositeId3], [t].[RootId], [t].[PeriodEnd], [t].[PeriodStart], [t].[Id], [t].[Discriminator], [t].[Name], [t].[PeriodEnd0], [t].[PeriodStart0], [t].[Number], [t].[IsGreen] + @"SELECT [e].[Key1], [e].[Key2], [e].[Key3], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [t].[RootSkipSharedId], [t].[CompositeKeySkipSharedKey1], [t].[CompositeKeySkipSharedKey2], [t].[CompositeKeySkipSharedKey3], [t].[PeriodEnd], [t].[PeriodStart], [t].[Id], [t].[Discriminator], [t].[Name], [t].[PeriodEnd0], [t].[PeriodStart0], [t].[Number], [t].[IsGreen] FROM [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN ( - SELECT [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [j].[RootId], [j].[PeriodEnd], [j].[PeriodStart], [e0].[Id], [e0].[Discriminator], [e0].[Name], [e0].[PeriodEnd] AS [PeriodEnd0], [e0].[PeriodStart] AS [PeriodStart0], [e0].[Number], [e0].[IsGreen] - FROM [JoinCompositeKeyToRootShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[RootId] = [e0].[Id] -) AS [t] ON (([e].[Key1] = [t].[CompositeId1]) AND ([e].[Key2] = [t].[CompositeId2])) AND ([e].[Key3] = [t].[CompositeId3]) -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [t].[CompositeId1], [t].[CompositeId2], [t].[CompositeId3], [t].[RootId]"); + SELECT [e0].[RootSkipSharedId], [e0].[CompositeKeySkipSharedKey1], [e0].[CompositeKeySkipSharedKey2], [e0].[CompositeKeySkipSharedKey3], [e0].[PeriodEnd], [e0].[PeriodStart], [e1].[Id], [e1].[Discriminator], [e1].[Name], [e1].[PeriodEnd] AS [PeriodEnd0], [e1].[PeriodStart] AS [PeriodStart0], [e1].[Number], [e1].[IsGreen] + FROM [EntityCompositeKeyEntityRoot] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] + INNER JOIN [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[RootSkipSharedId] = [e1].[Id] +) AS [t] ON (([e].[Key1] = [t].[CompositeKeySkipSharedKey1]) AND ([e].[Key2] = [t].[CompositeKeySkipSharedKey2])) AND ([e].[Key3] = [t].[CompositeKeySkipSharedKey3]) +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [t].[RootSkipSharedId], [t].[CompositeKeySkipSharedKey1], [t].[CompositeKeySkipSharedKey2], [t].[CompositeKeySkipSharedKey3]"); } public override async Task Include_skip_navigation_then_reference(bool async) @@ -666,15 +666,15 @@ public override async Task Include_skip_navigation_and_reference(bool async) await base.Include_skip_navigation_and_reference(async); AssertSql( - @"SELECT [e].[Id], [e].[CollectionInverseId], [e].[ExtraId], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[ReferenceInverseId], [e0].[Id], [t].[EntityOneId], [t].[EntityTwoId], [t].[PeriodEnd], [t].[PeriodStart], [t].[Id], [t].[Name], [t].[PeriodEnd0], [t].[PeriodStart0], [e0].[CollectionInverseId], [e0].[Name], [e0].[PeriodEnd], [e0].[PeriodStart], [e0].[ReferenceInverseId] + @"SELECT [e].[Id], [e].[CollectionInverseId], [e].[ExtraId], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[ReferenceInverseId], [e0].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId], [t].[PeriodEnd], [t].[PeriodStart], [t].[Id], [t].[Name], [t].[PeriodEnd0], [t].[PeriodStart0], [e0].[CollectionInverseId], [e0].[Name], [e0].[PeriodEnd], [e0].[PeriodStart], [e0].[ReferenceInverseId] FROM [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [e].[Id] = [e0].[ReferenceInverseId] LEFT JOIN ( - SELECT [e1].[EntityOneId], [e1].[EntityTwoId], [e1].[PeriodEnd], [e1].[PeriodStart], [e2].[Id], [e2].[Name], [e2].[PeriodEnd] AS [PeriodEnd0], [e2].[PeriodStart] AS [PeriodStart0] + SELECT [e1].[OneSkipSharedId], [e1].[TwoSkipSharedId], [e1].[PeriodEnd], [e1].[PeriodStart], [e2].[Id], [e2].[Name], [e2].[PeriodEnd] AS [PeriodEnd0], [e2].[PeriodStart] AS [PeriodStart0] FROM [EntityOneEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] - INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [e1].[EntityOneId] = [e2].[Id] -) AS [t] ON [e].[Id] = [t].[EntityTwoId] -ORDER BY [e].[Id], [e0].[Id], [t].[EntityOneId], [t].[EntityTwoId]"); + INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [e1].[OneSkipSharedId] = [e2].[Id] +) AS [t] ON [e].[Id] = [t].[TwoSkipSharedId] +ORDER BY [e].[Id], [e0].[Id], [t].[OneSkipSharedId], [t].[TwoSkipSharedId]"); } public override async Task Include_skip_navigation_then_include_inverse_works_for_tracking_query(bool async) @@ -733,18 +733,18 @@ public override async Task Filtered_include_skip_navigation_order_by_skip(bool a await base.Filtered_include_skip_navigation_order_by_skip(async); AssertSql( - @"SELECT [e].[Id], [e].[CollectionInverseId], [e].[ExtraId], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[ReferenceInverseId], [t0].[LeftId], [t0].[RightId], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name], [t0].[PeriodEnd0], [t0].[PeriodStart0], [t0].[ReferenceInverseId] + @"SELECT [e].[Id], [e].[CollectionInverseId], [e].[ExtraId], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[ReferenceInverseId], [t0].[SelfSkipSharedLeftId], [t0].[SelfSkipSharedRightId], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name], [t0].[PeriodEnd0], [t0].[PeriodStart0], [t0].[ReferenceInverseId] FROM [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN ( - SELECT [t].[LeftId], [t].[RightId], [t].[PeriodEnd], [t].[PeriodStart], [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[PeriodEnd0], [t].[PeriodStart0], [t].[ReferenceInverseId] + SELECT [t].[SelfSkipSharedLeftId], [t].[SelfSkipSharedRightId], [t].[PeriodEnd], [t].[PeriodStart], [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[PeriodEnd0], [t].[PeriodStart0], [t].[ReferenceInverseId] FROM ( - SELECT [j].[LeftId], [j].[RightId], [j].[PeriodEnd], [j].[PeriodStart], [e0].[Id], [e0].[CollectionInverseId], [e0].[ExtraId], [e0].[Name], [e0].[PeriodEnd] AS [PeriodEnd0], [e0].[PeriodStart] AS [PeriodStart0], [e0].[ReferenceInverseId], ROW_NUMBER() OVER(PARTITION BY [j].[LeftId] ORDER BY [e0].[Id]) AS [row] - FROM [JoinTwoSelfShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[RightId] = [e0].[Id] + SELECT [e0].[SelfSkipSharedLeftId], [e0].[SelfSkipSharedRightId], [e0].[PeriodEnd], [e0].[PeriodStart], [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[PeriodEnd] AS [PeriodEnd0], [e1].[PeriodStart] AS [PeriodStart0], [e1].[ReferenceInverseId], ROW_NUMBER() OVER(PARTITION BY [e0].[SelfSkipSharedLeftId] ORDER BY [e1].[Id]) AS [row] + FROM [EntityTwoEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] + INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[SelfSkipSharedRightId] = [e1].[Id] ) AS [t] WHERE 2 < [t].[row] -) AS [t0] ON [e].[Id] = [t0].[LeftId] -ORDER BY [e].[Id], [t0].[LeftId], [t0].[Id]"); +) AS [t0] ON [e].[Id] = [t0].[SelfSkipSharedLeftId] +ORDER BY [e].[Id], [t0].[SelfSkipSharedLeftId], [t0].[Id]"); } public override async Task Filtered_include_skip_navigation_order_by_take(bool async) @@ -752,18 +752,18 @@ public override async Task Filtered_include_skip_navigation_order_by_take(bool a await base.Filtered_include_skip_navigation_order_by_take(async); AssertSql( - @"SELECT [e].[Key1], [e].[Key2], [e].[Key3], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [t0].[TwoId], [t0].[CompositeId1], [t0].[CompositeId2], [t0].[CompositeId3], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name], [t0].[PeriodEnd0], [t0].[PeriodStart0], [t0].[ReferenceInverseId] + @"SELECT [e].[Key1], [e].[Key2], [e].[Key3], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [t0].[TwoSkipSharedId], [t0].[CompositeKeySkipSharedKey1], [t0].[CompositeKeySkipSharedKey2], [t0].[CompositeKeySkipSharedKey3], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name], [t0].[PeriodEnd0], [t0].[PeriodStart0], [t0].[ReferenceInverseId] FROM [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN ( - SELECT [t].[TwoId], [t].[CompositeId1], [t].[CompositeId2], [t].[CompositeId3], [t].[PeriodEnd], [t].[PeriodStart], [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[PeriodEnd0], [t].[PeriodStart0], [t].[ReferenceInverseId] + SELECT [t].[TwoSkipSharedId], [t].[CompositeKeySkipSharedKey1], [t].[CompositeKeySkipSharedKey2], [t].[CompositeKeySkipSharedKey3], [t].[PeriodEnd], [t].[PeriodStart], [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name], [t].[PeriodEnd0], [t].[PeriodStart0], [t].[ReferenceInverseId] FROM ( - SELECT [j].[TwoId], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [j].[PeriodEnd], [j].[PeriodStart], [e0].[Id], [e0].[CollectionInverseId], [e0].[ExtraId], [e0].[Name], [e0].[PeriodEnd] AS [PeriodEnd0], [e0].[PeriodStart] AS [PeriodStart0], [e0].[ReferenceInverseId], ROW_NUMBER() OVER(PARTITION BY [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3] ORDER BY [e0].[Id]) AS [row] - FROM [JoinTwoToCompositeKeyShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON [j].[TwoId] = [e0].[Id] + SELECT [e0].[TwoSkipSharedId], [e0].[CompositeKeySkipSharedKey1], [e0].[CompositeKeySkipSharedKey2], [e0].[CompositeKeySkipSharedKey3], [e0].[PeriodEnd], [e0].[PeriodStart], [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[PeriodEnd] AS [PeriodEnd0], [e1].[PeriodStart] AS [PeriodStart0], [e1].[ReferenceInverseId], ROW_NUMBER() OVER(PARTITION BY [e0].[CompositeKeySkipSharedKey1], [e0].[CompositeKeySkipSharedKey2], [e0].[CompositeKeySkipSharedKey3] ORDER BY [e1].[Id]) AS [row] + FROM [EntityCompositeKeyEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] + INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[TwoSkipSharedId] = [e1].[Id] ) AS [t] WHERE [t].[row] <= 2 -) AS [t0] ON (([e].[Key1] = [t0].[CompositeId1]) AND ([e].[Key2] = [t0].[CompositeId2])) AND ([e].[Key3] = [t0].[CompositeId3]) -ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [t0].[CompositeId1], [t0].[CompositeId2], [t0].[CompositeId3], [t0].[Id]"); +) AS [t0] ON (([e].[Key1] = [t0].[CompositeKeySkipSharedKey1]) AND ([e].[Key2] = [t0].[CompositeKeySkipSharedKey2])) AND ([e].[Key3] = [t0].[CompositeKeySkipSharedKey3]) +ORDER BY [e].[Key1], [e].[Key2], [e].[Key3], [t0].[CompositeKeySkipSharedKey1], [t0].[CompositeKeySkipSharedKey2], [t0].[CompositeKeySkipSharedKey3], [t0].[Id]"); } public override async Task Filtered_include_skip_navigation_order_by_skip_take(bool async) @@ -790,20 +790,20 @@ public override async Task Filtered_then_include_skip_navigation_where(bool asyn await base.Filtered_then_include_skip_navigation_where(async); AssertSql( - @"SELECT [e].[Id], [e].[Discriminator], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[Number], [e].[IsGreen], [t0].[EntityRootId], [t0].[EntityThreeId], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[Id], [t0].[CollectionInverseId], [t0].[Name], [t0].[PeriodEnd0], [t0].[PeriodStart0], [t0].[ReferenceInverseId], [t0].[OneId], [t0].[ThreeId], [t0].[Payload], [t0].[PeriodEnd1], [t0].[PeriodStart1], [t0].[Id0], [t0].[Name0], [t0].[PeriodEnd00], [t0].[PeriodStart00] + @"SELECT [e].[Id], [e].[Discriminator], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[Number], [e].[IsGreen], [t0].[RootSkipSharedId], [t0].[ThreeSkipSharedId], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[Id], [t0].[CollectionInverseId], [t0].[Name], [t0].[PeriodEnd0], [t0].[PeriodStart0], [t0].[ReferenceInverseId], [t0].[OneId], [t0].[ThreeId], [t0].[Payload], [t0].[PeriodEnd1], [t0].[PeriodStart1], [t0].[Id0], [t0].[Name0], [t0].[PeriodEnd00], [t0].[PeriodStart00] FROM [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN ( - SELECT [e0].[EntityRootId], [e0].[EntityThreeId], [e0].[PeriodEnd], [e0].[PeriodStart], [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[PeriodEnd] AS [PeriodEnd0], [e1].[PeriodStart] AS [PeriodStart0], [e1].[ReferenceInverseId], [t].[OneId], [t].[ThreeId], [t].[Payload], [t].[PeriodEnd] AS [PeriodEnd1], [t].[PeriodStart] AS [PeriodStart1], [t].[Id] AS [Id0], [t].[Name] AS [Name0], [t].[PeriodEnd0] AS [PeriodEnd00], [t].[PeriodStart0] AS [PeriodStart00] + SELECT [e0].[RootSkipSharedId], [e0].[ThreeSkipSharedId], [e0].[PeriodEnd], [e0].[PeriodStart], [e1].[Id], [e1].[CollectionInverseId], [e1].[Name], [e1].[PeriodEnd] AS [PeriodEnd0], [e1].[PeriodStart] AS [PeriodStart0], [e1].[ReferenceInverseId], [t].[OneId], [t].[ThreeId], [t].[Payload], [t].[PeriodEnd] AS [PeriodEnd1], [t].[PeriodStart] AS [PeriodStart1], [t].[Id] AS [Id0], [t].[Name] AS [Name0], [t].[PeriodEnd0] AS [PeriodEnd00], [t].[PeriodStart0] AS [PeriodStart00] FROM [EntityRootEntityThree] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] - INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[EntityThreeId] = [e1].[Id] + INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [e0].[ThreeSkipSharedId] = [e1].[Id] LEFT JOIN ( SELECT [j].[OneId], [j].[ThreeId], [j].[Payload], [j].[PeriodEnd], [j].[PeriodStart], [e2].[Id], [e2].[Name], [e2].[PeriodEnd] AS [PeriodEnd0], [e2].[PeriodStart] AS [PeriodStart0] FROM [JoinOneToThreePayloadFullShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] INNER JOIN [EntityOnes] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [j].[OneId] = [e2].[Id] WHERE [e2].[Id] < 10 ) AS [t] ON [e1].[Id] = [t].[ThreeId] -) AS [t0] ON [e].[Id] = [t0].[EntityRootId] -ORDER BY [e].[Id], [t0].[EntityRootId], [t0].[EntityThreeId], [t0].[Id], [t0].[OneId], [t0].[ThreeId]"); +) AS [t0] ON [e].[Id] = [t0].[RootSkipSharedId] +ORDER BY [e].[Id], [t0].[RootSkipSharedId], [t0].[ThreeSkipSharedId], [t0].[Id], [t0].[OneId], [t0].[ThreeId]"); } public override async Task Filtered_then_include_skip_navigation_order_by_skip_take(bool async) @@ -811,23 +811,23 @@ public override async Task Filtered_then_include_skip_navigation_order_by_skip_t await base.Filtered_then_include_skip_navigation_order_by_skip_take(async); AssertSql( - @"SELECT [e].[Id], [e].[Discriminator], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[Number], [e].[IsGreen], [t1].[CompositeId1], [t1].[CompositeId2], [t1].[CompositeId3], [t1].[RootId], [t1].[PeriodEnd], [t1].[PeriodStart], [t1].[Key1], [t1].[Key2], [t1].[Key3], [t1].[Name], [t1].[PeriodEnd0], [t1].[PeriodStart0], [t1].[Id], [t1].[CompositeId10], [t1].[CompositeId20], [t1].[CompositeId30], [t1].[PeriodEnd1], [t1].[PeriodStart1], [t1].[ThreeId], [t1].[Id0], [t1].[CollectionInverseId], [t1].[Name0], [t1].[PeriodEnd00], [t1].[PeriodStart00], [t1].[ReferenceInverseId] + @"SELECT [e].[Id], [e].[Discriminator], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[Number], [e].[IsGreen], [t1].[RootSkipSharedId], [t1].[CompositeKeySkipSharedKey1], [t1].[CompositeKeySkipSharedKey2], [t1].[CompositeKeySkipSharedKey3], [t1].[PeriodEnd], [t1].[PeriodStart], [t1].[Key1], [t1].[Key2], [t1].[Key3], [t1].[Name], [t1].[PeriodEnd0], [t1].[PeriodStart0], [t1].[Id], [t1].[CompositeId1], [t1].[CompositeId2], [t1].[CompositeId3], [t1].[PeriodEnd1], [t1].[PeriodStart1], [t1].[ThreeId], [t1].[Id0], [t1].[CollectionInverseId], [t1].[Name0], [t1].[PeriodEnd00], [t1].[PeriodStart00], [t1].[ReferenceInverseId] FROM [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN ( - SELECT [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [j].[RootId], [j].[PeriodEnd], [j].[PeriodStart], [e0].[Key1], [e0].[Key2], [e0].[Key3], [e0].[Name], [e0].[PeriodEnd] AS [PeriodEnd0], [e0].[PeriodStart] AS [PeriodStart0], [t0].[Id], [t0].[CompositeId1] AS [CompositeId10], [t0].[CompositeId2] AS [CompositeId20], [t0].[CompositeId3] AS [CompositeId30], [t0].[PeriodEnd] AS [PeriodEnd1], [t0].[PeriodStart] AS [PeriodStart1], [t0].[ThreeId], [t0].[Id0], [t0].[CollectionInverseId], [t0].[Name] AS [Name0], [t0].[PeriodEnd0] AS [PeriodEnd00], [t0].[PeriodStart0] AS [PeriodStart00], [t0].[ReferenceInverseId] - FROM [JoinCompositeKeyToRootShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] - INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON (([j].[CompositeId1] = [e0].[Key1]) AND ([j].[CompositeId2] = [e0].[Key2])) AND ([j].[CompositeId3] = [e0].[Key3]) + SELECT [e0].[RootSkipSharedId], [e0].[CompositeKeySkipSharedKey1], [e0].[CompositeKeySkipSharedKey2], [e0].[CompositeKeySkipSharedKey3], [e0].[PeriodEnd], [e0].[PeriodStart], [e1].[Key1], [e1].[Key2], [e1].[Key3], [e1].[Name], [e1].[PeriodEnd] AS [PeriodEnd0], [e1].[PeriodStart] AS [PeriodStart0], [t0].[Id], [t0].[CompositeId1], [t0].[CompositeId2], [t0].[CompositeId3], [t0].[PeriodEnd] AS [PeriodEnd1], [t0].[PeriodStart] AS [PeriodStart1], [t0].[ThreeId], [t0].[Id0], [t0].[CollectionInverseId], [t0].[Name] AS [Name0], [t0].[PeriodEnd0] AS [PeriodEnd00], [t0].[PeriodStart0] AS [PeriodStart00], [t0].[ReferenceInverseId] + FROM [EntityCompositeKeyEntityRoot] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] + INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON (([e0].[CompositeKeySkipSharedKey1] = [e1].[Key1]) AND ([e0].[CompositeKeySkipSharedKey2] = [e1].[Key2])) AND ([e0].[CompositeKeySkipSharedKey3] = [e1].[Key3]) LEFT JOIN ( SELECT [t].[Id], [t].[CompositeId1], [t].[CompositeId2], [t].[CompositeId3], [t].[PeriodEnd], [t].[PeriodStart], [t].[ThreeId], [t].[Id0], [t].[CollectionInverseId], [t].[Name], [t].[PeriodEnd0], [t].[PeriodStart0], [t].[ReferenceInverseId] FROM ( - SELECT [j0].[Id], [j0].[CompositeId1], [j0].[CompositeId2], [j0].[CompositeId3], [j0].[PeriodEnd], [j0].[PeriodStart], [j0].[ThreeId], [e1].[Id] AS [Id0], [e1].[CollectionInverseId], [e1].[Name], [e1].[PeriodEnd] AS [PeriodEnd0], [e1].[PeriodStart] AS [PeriodStart0], [e1].[ReferenceInverseId], ROW_NUMBER() OVER(PARTITION BY [j0].[CompositeId1], [j0].[CompositeId2], [j0].[CompositeId3] ORDER BY [e1].[Id]) AS [row] - FROM [JoinThreeToCompositeKeyFull] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j0] - INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [j0].[ThreeId] = [e1].[Id] + SELECT [j].[Id], [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [j].[PeriodEnd], [j].[PeriodStart], [j].[ThreeId], [e2].[Id] AS [Id0], [e2].[CollectionInverseId], [e2].[Name], [e2].[PeriodEnd] AS [PeriodEnd0], [e2].[PeriodStart] AS [PeriodStart0], [e2].[ReferenceInverseId], ROW_NUMBER() OVER(PARTITION BY [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3] ORDER BY [e2].[Id]) AS [row] + FROM [JoinThreeToCompositeKeyFull] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] + INNER JOIN [EntityThrees] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [j].[ThreeId] = [e2].[Id] ) AS [t] WHERE (1 < [t].[row]) AND ([t].[row] <= 3) - ) AS [t0] ON (([e0].[Key1] = [t0].[CompositeId1]) AND ([e0].[Key2] = [t0].[CompositeId2])) AND ([e0].[Key3] = [t0].[CompositeId3]) -) AS [t1] ON [e].[Id] = [t1].[RootId] -ORDER BY [e].[Id], [t1].[CompositeId1], [t1].[CompositeId2], [t1].[CompositeId3], [t1].[RootId], [t1].[Key1], [t1].[Key2], [t1].[Key3], [t1].[CompositeId10], [t1].[CompositeId20], [t1].[CompositeId30], [t1].[Id0]"); + ) AS [t0] ON (([e1].[Key1] = [t0].[CompositeId1]) AND ([e1].[Key2] = [t0].[CompositeId2])) AND ([e1].[Key3] = [t0].[CompositeId3]) +) AS [t1] ON [e].[Id] = [t1].[RootSkipSharedId] +ORDER BY [e].[Id], [t1].[RootSkipSharedId], [t1].[CompositeKeySkipSharedKey1], [t1].[CompositeKeySkipSharedKey2], [t1].[CompositeKeySkipSharedKey3], [t1].[Key1], [t1].[Key2], [t1].[Key3], [t1].[CompositeId1], [t1].[CompositeId2], [t1].[CompositeId3], [t1].[Id0]"); } public override async Task Filtered_include_skip_navigation_where_then_include_skip_navigation(bool async) @@ -835,21 +835,21 @@ public override async Task Filtered_include_skip_navigation_where_then_include_s await base.Filtered_include_skip_navigation_where_then_include_skip_navigation(async); AssertSql( - @"SELECT [e].[Id], [e].[Discriminator], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[Number], [e].[IsGreen], [t0].[CompositeId1], [t0].[CompositeId2], [t0].[CompositeId3], [t0].[LeafId], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[Key1], [t0].[Key2], [t0].[Key3], [t0].[Name], [t0].[PeriodEnd0], [t0].[PeriodStart0], [t0].[TwoId], [t0].[CompositeId10], [t0].[CompositeId20], [t0].[CompositeId30], [t0].[PeriodEnd1], [t0].[PeriodStart1], [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name0], [t0].[PeriodEnd00], [t0].[PeriodStart00], [t0].[ReferenceInverseId] + @"SELECT [e].[Id], [e].[Discriminator], [e].[Name], [e].[PeriodEnd], [e].[PeriodStart], [e].[Number], [e].[IsGreen], [t0].[CompositeId1], [t0].[CompositeId2], [t0].[CompositeId3], [t0].[LeafId], [t0].[PeriodEnd], [t0].[PeriodStart], [t0].[Key1], [t0].[Key2], [t0].[Key3], [t0].[Name], [t0].[PeriodEnd0], [t0].[PeriodStart0], [t0].[TwoSkipSharedId], [t0].[CompositeKeySkipSharedKey1], [t0].[CompositeKeySkipSharedKey2], [t0].[CompositeKeySkipSharedKey3], [t0].[PeriodEnd1], [t0].[PeriodStart1], [t0].[Id], [t0].[CollectionInverseId], [t0].[ExtraId], [t0].[Name0], [t0].[PeriodEnd00], [t0].[PeriodStart00], [t0].[ReferenceInverseId] FROM [EntityRoots] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e] LEFT JOIN ( - SELECT [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [j].[LeafId], [j].[PeriodEnd], [j].[PeriodStart], [e0].[Key1], [e0].[Key2], [e0].[Key3], [e0].[Name], [e0].[PeriodEnd] AS [PeriodEnd0], [e0].[PeriodStart] AS [PeriodStart0], [t].[TwoId], [t].[CompositeId1] AS [CompositeId10], [t].[CompositeId2] AS [CompositeId20], [t].[CompositeId3] AS [CompositeId30], [t].[PeriodEnd] AS [PeriodEnd1], [t].[PeriodStart] AS [PeriodStart1], [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name] AS [Name0], [t].[PeriodEnd0] AS [PeriodEnd00], [t].[PeriodStart0] AS [PeriodStart00], [t].[ReferenceInverseId] + SELECT [j].[CompositeId1], [j].[CompositeId2], [j].[CompositeId3], [j].[LeafId], [j].[PeriodEnd], [j].[PeriodStart], [e0].[Key1], [e0].[Key2], [e0].[Key3], [e0].[Name], [e0].[PeriodEnd] AS [PeriodEnd0], [e0].[PeriodStart] AS [PeriodStart0], [t].[TwoSkipSharedId], [t].[CompositeKeySkipSharedKey1], [t].[CompositeKeySkipSharedKey2], [t].[CompositeKeySkipSharedKey3], [t].[PeriodEnd] AS [PeriodEnd1], [t].[PeriodStart] AS [PeriodStart1], [t].[Id], [t].[CollectionInverseId], [t].[ExtraId], [t].[Name] AS [Name0], [t].[PeriodEnd0] AS [PeriodEnd00], [t].[PeriodStart0] AS [PeriodStart00], [t].[ReferenceInverseId] FROM [JoinCompositeKeyToLeaf] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j] INNER JOIN [EntityCompositeKeys] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e0] ON (([j].[CompositeId1] = [e0].[Key1]) AND ([j].[CompositeId2] = [e0].[Key2])) AND ([j].[CompositeId3] = [e0].[Key3]) LEFT JOIN ( - SELECT [j0].[TwoId], [j0].[CompositeId1], [j0].[CompositeId2], [j0].[CompositeId3], [j0].[PeriodEnd], [j0].[PeriodStart], [e1].[Id], [e1].[CollectionInverseId], [e1].[ExtraId], [e1].[Name], [e1].[PeriodEnd] AS [PeriodEnd0], [e1].[PeriodStart] AS [PeriodStart0], [e1].[ReferenceInverseId] - FROM [JoinTwoToCompositeKeyShared] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [j0] - INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] ON [j0].[TwoId] = [e1].[Id] - ) AS [t] ON (([e0].[Key1] = [t].[CompositeId1]) AND ([e0].[Key2] = [t].[CompositeId2])) AND ([e0].[Key3] = [t].[CompositeId3]) + SELECT [e1].[TwoSkipSharedId], [e1].[CompositeKeySkipSharedKey1], [e1].[CompositeKeySkipSharedKey2], [e1].[CompositeKeySkipSharedKey3], [e1].[PeriodEnd], [e1].[PeriodStart], [e2].[Id], [e2].[CollectionInverseId], [e2].[ExtraId], [e2].[Name], [e2].[PeriodEnd] AS [PeriodEnd0], [e2].[PeriodStart] AS [PeriodStart0], [e2].[ReferenceInverseId] + FROM [EntityCompositeKeyEntityTwo] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e1] + INNER JOIN [EntityTwos] FOR SYSTEM_TIME AS OF '2010-01-01T00:00:00.0000000' AS [e2] ON [e1].[TwoSkipSharedId] = [e2].[Id] + ) AS [t] ON (([e0].[Key1] = [t].[CompositeKeySkipSharedKey1]) AND ([e0].[Key2] = [t].[CompositeKeySkipSharedKey2])) AND ([e0].[Key3] = [t].[CompositeKeySkipSharedKey3]) WHERE [e0].[Key1] < 5 ) AS [t0] ON [e].[Id] = [t0].[LeafId] WHERE [e].[Discriminator] = N'EntityLeaf' -ORDER BY [e].[Id], [t0].[CompositeId1], [t0].[CompositeId2], [t0].[CompositeId3], [t0].[LeafId], [t0].[Key1], [t0].[Key2], [t0].[Key3], [t0].[TwoId], [t0].[CompositeId10], [t0].[CompositeId20], [t0].[CompositeId30]"); +ORDER BY [e].[Id], [t0].[CompositeId1], [t0].[CompositeId2], [t0].[CompositeId3], [t0].[LeafId], [t0].[Key1], [t0].[Key2], [t0].[Key3], [t0].[TwoSkipSharedId], [t0].[CompositeKeySkipSharedKey1], [t0].[CompositeKeySkipSharedKey2], [t0].[CompositeKeySkipSharedKey3]"); } public override async Task Filtered_include_skip_navigation_order_by_skip_take_then_include_skip_navigation_where(bool async)