Skip to content

Commit

Permalink
Query: Re-enable test for #22896 (#25795)
Browse files Browse the repository at this point in the history
Resolves #22896
  • Loading branch information
smitpatel committed Aug 31, 2021
1 parent 1268d12 commit 7538900
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4027,7 +4027,7 @@ public virtual Task Collection_FirstOrDefault_entity_reference_accesses_in_proje
}));
}
[ConditionalTheory(Skip = "issue #22896")]
[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task Collection_FirstOrDefault_entity_collection_accesses_in_projection(bool async)
{
Expand All @@ -4041,7 +4041,13 @@ public virtual Task Collection_FirstOrDefault_entity_collection_accesses_in_proj
Pushdown = l1.OneToMany_Optional1
.Where(x => x.Name == "L2 02")
.FirstOrDefault().OneToMany_Optional2.ToList()
}));
}),
elementSorter: e => e.Id,
elementAsserter: (e, a) =>
{
Assert.Equal(e.Id, a.Id);
AssertCollection(e.Pushdown, a.Pushdown);
});
}
[ConditionalTheory]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3677,7 +3677,20 @@ public override async Task Collection_FirstOrDefault_entity_collection_accesses_
await base.Collection_FirstOrDefault_entity_collection_accesses_in_projection(async);

AssertSql(
@"");
@"SELECT [l].[Id], [t0].[Id], [l1].[Id], [l1].[Level2_Optional_Id], [l1].[Level2_Required_Id], [l1].[Name], [l1].[OneToMany_Optional_Inverse3Id], [l1].[OneToMany_Optional_Self_Inverse3Id], [l1].[OneToMany_Required_Inverse3Id], [l1].[OneToMany_Required_Self_Inverse3Id], [l1].[OneToOne_Optional_PK_Inverse3Id], [l1].[OneToOne_Optional_Self3Id], [t0].[c]
FROM [LevelOne] AS [l]
LEFT JOIN (
SELECT [t].[c], [t].[Id], [t].[OneToMany_Optional_Inverse2Id]
FROM (
SELECT 1 AS [c], [l0].[Id], [l0].[OneToMany_Optional_Inverse2Id], ROW_NUMBER() OVER(PARTITION BY [l0].[OneToMany_Optional_Inverse2Id] ORDER BY [l0].[Id]) AS [row]
FROM [LevelTwo] AS [l0]
WHERE [l0].[Name] = N'L2 02'
) AS [t]
WHERE [t].[row] <= 1
) AS [t0] ON [l].[Id] = [t0].[OneToMany_Optional_Inverse2Id]
LEFT JOIN [LevelThree] AS [l1] ON [t0].[Id] = [l1].[OneToMany_Optional_Inverse3Id]
WHERE [l].[Id] < 2
ORDER BY [l].[Id], [t0].[Id]");
}

public override async Task Multiple_collection_FirstOrDefault_followed_by_member_access_in_projection(bool async)
Expand Down

0 comments on commit 7538900

Please sign in to comment.