File tree 3 files changed +25
-1
lines changed
3 files changed +25
-1
lines changed Original file line number Diff line number Diff line change @@ -328,6 +328,17 @@ where timesheet.Entries.AsQueryable().Any(e => !new[] { 1 }.Contains(e.Id))
328
328
Assert . That ( query . Count , Is . EqualTo ( 2 ) ) ;
329
329
}
330
330
331
+ [ Test ( Description = "GH-2471" ) ]
332
+ public async Task TimeSheetsWithStringContainsSubQueryWithAsQueryableAfterWhereAsync ( )
333
+ {
334
+ var query = await ( (
335
+ from timesheet in db . Timesheets
336
+ where timesheet . Entries . Where ( e => e . Comments != null ) . AsQueryable ( ) . Any ( e => e . Comments . Contains ( "testing" ) )
337
+ select timesheet ) . ToListAsync ( ) ) ;
338
+
339
+ Assert . That ( query . Count , Is . EqualTo ( 2 ) ) ;
340
+ }
341
+
331
342
[ Test ( Description = "NH-3002" ) ]
332
343
public async Task HqlOrderLinesWithInnerJoinAndSubQueryAsync ( )
333
344
{
Original file line number Diff line number Diff line change @@ -372,6 +372,17 @@ where timesheet.Entries.AsQueryable().Any(e => !new[] { 1 }.Contains(e.Id))
372
372
Assert . That ( query . Count , Is . EqualTo ( 2 ) ) ;
373
373
}
374
374
375
+ [ Test ( Description = "GH-2471" ) ]
376
+ public void TimeSheetsWithStringContainsSubQueryWithAsQueryableAfterWhere ( )
377
+ {
378
+ var query = (
379
+ from timesheet in db . Timesheets
380
+ where timesheet . Entries . Where ( e => e . Comments != null ) . AsQueryable ( ) . Any ( e => e . Comments . Contains ( "testing" ) )
381
+ select timesheet ) . ToList ( ) ;
382
+
383
+ Assert . That ( query . Count , Is . EqualTo ( 2 ) ) ;
384
+ }
385
+
375
386
[ Test ( Description = "NH-3002" ) ]
376
387
public void HqlOrderLinesWithInnerJoinAndSubQuery ( )
377
388
{
Original file line number Diff line number Diff line change 4
4
using Remotion . Linq . Clauses ;
5
5
using Remotion . Linq . Clauses . Expressions ;
6
6
using Remotion . Linq . Clauses . ExpressionVisitors ;
7
+ using Remotion . Linq . Clauses . ResultOperators ;
7
8
using Remotion . Linq . EagerFetching ;
8
9
9
10
namespace NHibernate . Linq . Visitors
@@ -15,7 +16,8 @@ public class SubQueryFromClauseFlattener : NhQueryModelVisitorBase
15
16
typeof ( LockResultOperator ) ,
16
17
typeof ( FetchLazyPropertiesResultOperator ) ,
17
18
typeof ( FetchOneRequest ) ,
18
- typeof ( FetchManyRequest )
19
+ typeof ( FetchManyRequest ) ,
20
+ typeof ( AsQueryableResultOperator )
19
21
} ;
20
22
21
23
public static void ReWrite ( QueryModel queryModel )
You can’t perform that action at this time.
0 commit comments