File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed
NHibernate.Test/NHSpecificTest/Futures Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -155,6 +155,21 @@ public void FutureValueOfLinqCanGetSingleEntityWhenQueryBatchingIsNotSupported()
155
155
}
156
156
}
157
157
158
+ [ Test ]
159
+ public void FutureValueWithSelectorOfLinqCanGetSingleEntityWhenQueryBatchingIsNotSupported ( )
160
+ {
161
+ var personId = CreatePerson ( ) ;
162
+
163
+ using ( var session = OpenSession ( ) )
164
+ {
165
+ var futurePerson = session
166
+ . Query < Person > ( )
167
+ . Where ( x => x . Id == personId )
168
+ . ToFutureValue ( q => q . FirstOrDefault ( ) ) ;
169
+ Assert . IsNotNull ( futurePerson . Value ) ;
170
+ }
171
+ }
172
+
158
173
private int CreatePerson ( )
159
174
{
160
175
using ( var session = Sfi . OpenSession ( ) )
Original file line number Diff line number Diff line change @@ -886,7 +886,7 @@ public IEnumerable<T> Future<T>()
886
886
{
887
887
if ( ! session . Factory . ConnectionProvider . Driver . SupportsMultipleQueries )
888
888
{
889
- return List < T > ( ) ;
889
+ return new DelayedEnumerator < T > ( List < T > ) ;
890
890
}
891
891
892
892
session . FutureQueryBatch . Add < T > ( this ) ;
You can’t perform that action at this time.
0 commit comments