Skip to content

Query: Add regression test for #21003 #23480

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
1 commit merged into from
Dec 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3009,6 +3009,33 @@ public virtual Task GroupBy_scalar_aggregate_in_set_operation(bool async)
elementSorter: e => (e.CustomerID, e.Sequence));
}

[ConditionalTheory]
[MemberData(nameof(IsAsyncData))]
public virtual Task AsEnumerable_in_subquery_for_GroupBy(bool async)
{
return AssertTranslationFailed(
() => AssertQuery(
async,
ss => ss.Set<Customer>()
.Where(c => c.CustomerID.StartsWith("F"))
.Select(c => new
{
Customer = c,
Orders = ss.Set<Order>()
.Where(o => o.CustomerID == c.CustomerID)
.AsEnumerable()
.GroupBy(o => o.CustomerID)
.Select(g => g.OrderByDescending(e => e.OrderDate).FirstOrDefault())
.ToList()
}),
elementSorter: e => e.Customer.CustomerID,
elementAsserter: (e, a) =>
{
AssertEqual(e.Customer, a.Customer);
AssertCollection(e.Orders, a.Orders);
}));
}

#endregion
}
}