File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -897,6 +897,22 @@ into g
897
897
ObjectDumper . Write ( q , 1 ) ;
898
898
}
899
899
900
+ [ Test ]
901
+ public void GroupTwoQueriesAndSum ( )
902
+ {
903
+ //NH-3534
904
+ var queryWithAggregation = from o1 in db . Orders
905
+ from o2 in db . Orders
906
+ where o1 . Customer . CustomerId == o2 . Customer . CustomerId && o1 . OrderDate == o2 . OrderDate
907
+ group o1 by new { o1 . Customer . CustomerId , o1 . OrderDate } into g
908
+ select new { CustomerId = g . Key . CustomerId , LastOrderDate = g . Max ( x => x . OrderDate ) } ;
909
+
910
+ var result = queryWithAggregation . ToList ( ) ;
911
+
912
+ Assert . IsNotNull ( result ) ;
913
+ Assert . IsNotEmpty ( result ) ;
914
+ }
915
+
900
916
[ Category ( "GROUP BY/HAVING" ) ]
901
917
[ Test ( Description = "This sample uses a where clause after a group by clause " +
902
918
"to find all categories that have at least 10 products." ) ]
You can’t perform that action at this time.
0 commit comments