Skip to content

Commit d4b0f5a

Browse files
committed
Add test for #3076
1 parent bf8bfd2 commit d4b0f5a

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/NHibernate.Test/Linq/ByMethod/GroupByTests.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,15 @@ public void GroupByComputedValueFromNestedObjectSelect()
840840
Assert.AreEqual(2155, orderGroups.Sum(g => g.Count));
841841
}
842842

843+
[Test(Description="GH-3076")]
844+
public void NestedGroupBy()
845+
{
846+
var list = db.OrderLines
847+
.GroupBy(x => new { x.Order.OrderId, x.Product.ProductId }) // this works fine
848+
.GroupBy(x => x.Key.ProductId) // exception: "A recognition error occurred"
849+
.ToList();
850+
}
851+
843852
private static void CheckGrouping<TKey, TElement>(IEnumerable<IGrouping<TKey, TElement>> groupedItems, Func<TElement, TKey> groupBy)
844853
{
845854
var used = new HashSet<object>();

0 commit comments

Comments
 (0)