File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 12
12
using System . Linq ;
13
13
using System . Linq . Expressions ;
14
14
using NHibernate . DomainModel . Northwind . Entities ;
15
- using NUnit . Framework ;
16
15
using NHibernate . Linq ;
16
+ using NUnit . Framework ;
17
17
18
18
namespace NHibernate . Test . Linq
19
19
{
Original file line number Diff line number Diff line change 2
2
using System . Linq ;
3
3
using System . Linq . Expressions ;
4
4
using NHibernate . DomainModel . Northwind . Entities ;
5
+ using NHibernate . Linq ;
5
6
using NUnit . Framework ;
6
7
7
8
namespace NHibernate . Test . Linq
@@ -509,6 +510,26 @@ where subquery.Any(x => x.OrderId == order.OrderId)
509
510
Assert . That ( query . Count , Is . EqualTo ( 61 ) ) ;
510
511
}
511
512
513
+ [ Test ( Description = "GH2479" ) ]
514
+ public void OrdersWithSubquery9 ( )
515
+ {
516
+ var query = db . Orders
517
+ . Where ( x => x . Employee . EmployeeId > 5 )
518
+ . OrderBy ( x => x . OrderId )
519
+ . Take ( 2 ) ;
520
+
521
+ var listFuture = db . OrderLines
522
+ . Where ( x => query . Any ( o => o == x . Order ) )
523
+ . OrderBy ( x => x . Id )
524
+ . ToFuture ( ) ;
525
+
526
+ var results = query . ToFuture ( ) . ToList ( ) ;
527
+ var listResults = listFuture . ToList ( ) ;
528
+
529
+ Assert . That ( results . Count , Is . EqualTo ( 2 ) , nameof ( results ) ) ;
530
+ Assert . That ( listResults . Count , Is . EqualTo ( 6 ) , nameof ( listResults ) ) ;
531
+ }
532
+
512
533
[ Test ( Description = "NH-2654" ) ]
513
534
public void CategoriesWithDiscountedProducts ( )
514
535
{
You can’t perform that action at this time.
0 commit comments