File tree Expand file tree Collapse file tree 3 files changed +25
-1
lines changed Expand file tree Collapse file tree 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))
328328 Assert . That ( query . Count , Is . EqualTo ( 2 ) ) ;
329329 }
330330
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+
331342 [ Test ( Description = "NH-3002" ) ]
332343 public async Task HqlOrderLinesWithInnerJoinAndSubQueryAsync ( )
333344 {
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))
372372 Assert . That ( query . Count , Is . EqualTo ( 2 ) ) ;
373373 }
374374
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+
375386 [ Test ( Description = "NH-3002" ) ]
376387 public void HqlOrderLinesWithInnerJoinAndSubQuery ( )
377388 {
Original file line number Diff line number Diff line change 44using Remotion . Linq . Clauses ;
55using Remotion . Linq . Clauses . Expressions ;
66using Remotion . Linq . Clauses . ExpressionVisitors ;
7+ using Remotion . Linq . Clauses . ResultOperators ;
78using Remotion . Linq . EagerFetching ;
89
910namespace NHibernate . Linq . Visitors
@@ -15,7 +16,8 @@ public class SubQueryFromClauseFlattener : NhQueryModelVisitorBase
1516 typeof ( LockResultOperator ) ,
1617 typeof ( FetchLazyPropertiesResultOperator ) ,
1718 typeof ( FetchOneRequest ) ,
18- typeof ( FetchManyRequest )
19+ typeof ( FetchManyRequest ) ,
20+ typeof ( AsQueryableResultOperator )
1921 } ;
2022
2123 public static void ReWrite ( QueryModel queryModel )
You can’t perform that action at this time.
0 commit comments