@@ -198,12 +198,12 @@ internal static IEnumerable<dynamic> ExecuteQueryInternal(this IDbConnection con
198
198
{
199
199
using ( var reader = command . ExecuteReader ( ) )
200
200
{
201
- var result = DataReader . ToEnumerable ( reader , dbFields , connection . GetDbSetting ( ) ) ;
201
+ var result = DataReader . ToEnumerable ( reader , dbFields , connection . GetDbSetting ( ) ) . AsList ( ) ;
202
202
203
203
// Set Cache
204
204
if ( cacheKey != null )
205
205
{
206
- cache ? . Add ( cacheKey , result , cacheItemExpiration . GetValueOrDefault ( ) , false ) ;
206
+ cache ? . Add ( cacheKey , ( IEnumerable < dynamic > ) result , cacheItemExpiration . GetValueOrDefault ( ) , false ) ;
207
207
}
208
208
209
209
// Return
@@ -320,7 +320,7 @@ internal static async Task<IEnumerable<dynamic>> ExecuteQueryAsyncInternal(this
320
320
// Set Cache
321
321
if ( cacheKey != null )
322
322
{
323
- cache ? . Add ( cacheKey , result , cacheItemExpiration . GetValueOrDefault ( ) , false ) ;
323
+ cache ? . Add ( cacheKey , ( IEnumerable < dynamic > ) result , cacheItemExpiration . GetValueOrDefault ( ) , false ) ;
324
324
}
325
325
326
326
// Return
@@ -567,13 +567,12 @@ private static IEnumerable<TResult> ExecuteQueryInternalForType<TResult>(this ID
567
567
{
568
568
using ( var reader = command . ExecuteReader ( ) )
569
569
{
570
- var result = DataReader . ToEnumerable < TResult > ( reader ,
571
- dbFields , connection . GetDbSetting ( ) ) ;
570
+ var result = DataReader . ToEnumerable < TResult > ( reader , dbFields , connection . GetDbSetting ( ) ) . AsList ( ) ;
572
571
573
572
// Set Cache
574
573
if ( cacheKey != null )
575
574
{
576
- cache ? . Add ( cacheKey , result , cacheItemExpiration . GetValueOrDefault ( ) , false ) ;
575
+ cache ? . Add ( cacheKey , ( IEnumerable < TResult > ) result , cacheItemExpiration . GetValueOrDefault ( ) , false ) ;
577
576
}
578
577
579
578
// Return
@@ -826,7 +825,7 @@ private static async Task<IEnumerable<TResult>> ExecuteQueryAsyncInternalForType
826
825
// Set Cache
827
826
if ( cacheKey != null )
828
827
{
829
- cache ? . Add ( cacheKey , result , cacheItemExpiration . GetValueOrDefault ( ) , false ) ;
828
+ cache ? . Add ( cacheKey , ( IEnumerable < TResult > ) result , cacheItemExpiration . GetValueOrDefault ( ) , false ) ;
830
829
}
831
830
832
831
// Return
0 commit comments