diff --git a/src/EFCore.SqlServer/Query/Internal/SqlServerJsonPostprocessor.cs b/src/EFCore.SqlServer/Query/Internal/SqlServerJsonPostprocessor.cs index 512a48ad5aa..a1353304357 100644 --- a/src/EFCore.SqlServer/Query/Internal/SqlServerJsonPostprocessor.cs +++ b/src/EFCore.SqlServer/Query/Internal/SqlServerJsonPostprocessor.cs @@ -69,7 +69,9 @@ public virtual Expression Process(Expression expression) switch (expression) { case ShapedQueryExpression shapedQueryExpression: - return shapedQueryExpression.UpdateQueryExpression(Visit(shapedQueryExpression.QueryExpression)); + return shapedQueryExpression + .UpdateQueryExpression(Visit(shapedQueryExpression.QueryExpression)) + .UpdateShaperExpression(Visit(shapedQueryExpression.ShaperExpression)); case SelectExpression selectExpression: { diff --git a/test/EFCore.SqlServer.FunctionalTests/Query/NonSharedPrimitiveCollectionsQuerySqlServerTest.cs b/test/EFCore.SqlServer.FunctionalTests/Query/NonSharedPrimitiveCollectionsQuerySqlServerTest.cs index 03f32440c02..83fcfd92a2c 100644 --- a/test/EFCore.SqlServer.FunctionalTests/Query/NonSharedPrimitiveCollectionsQuerySqlServerTest.cs +++ b/test/EFCore.SqlServer.FunctionalTests/Query/NonSharedPrimitiveCollectionsQuerySqlServerTest.cs @@ -871,6 +871,42 @@ public virtual async Task Same_collection_with_conflicting_type_mappings_not_sup #endregion Type mapping inference + [ConditionalFact] + public virtual async Task Ordered_collection_with_split_query() + { + var contextFactory = await InitializeAsync( + onModelCreating: mb => mb.Entity(), + seed: context => + { + context.Add(new Context32976.Principal { Ints = [2, 3, 4]}); + context.SaveChanges(); + }); + + await using var context = contextFactory.CreateContext(); + + _ = await context.Set() + .Where(p => p.Ints.Skip(1).Contains(3)) + .Include(p => p.Dependents) + .AsSplitQuery() + .SingleAsync(); + } + + public class Context32976(DbContextOptions options) : DbContext(options) + { + public class Principal + { + public int Id { get; set; } + public List Ints { get; set; } + public List Dependents { get; set; } + } + + public class Dependent + { + public int Id { get; set; } + public Principal Principal { get; set; } + } + } + [ConditionalFact] public virtual void Check_all_tests_overridden() => TestHelpers.AssertAllMethodsOverridden(GetType());