@@ -275,31 +275,30 @@ private IEnumerable<JObject> InternalGet(string commandText, params SqlParameter
275275 EnsureTable ( ) ;
276276
277277 using SqlConnection connection = context . OpenConnection ( ) ;
278- List < JObject > entities = GetEntities ( commandText , parameters , connection ) ;
278+ List < JObject > entities = GetEntities ( commandText , parameters , connection ) . ToList ( ) ;
279279 // Migrate must execute after the get/read operation in order not to affect the "get" SQL operation
280- entities = MigrateEntities ( entities , connection ) ;
280+ entities = MigrateEntities ( entities , connection ) . ToList ( ) ;
281281 return entities ;
282282 }
283283
284- private List < JObject > GetEntities ( string commandText , SqlParameter [ ] parameters , SqlConnection connection )
284+ private IEnumerable < JObject > GetEntities ( string commandText , SqlParameter [ ] parameters , SqlConnection connection , bool updateOnRead = false )
285285 {
286286 List < JObject > entities = new List < JObject > ( ) ;
287287 using SqlCommand command = new SqlCommand ( commandText , connection ) ;
288288 command . CommandTimeout = context . SqlServerConfiguration . ReadCommandTimeout ;
289289 command . Parameters . AddRange ( parameters ) ;
290290
291291 //TODO: Dynamically read columns.
292- using ( SqlDataReader dataReader = command . ExecuteReader ( ) )
293- {
292+ using ( SqlDataReader dataReader = command . ExecuteReader ( ) ) {
294293 entities . AddRange ( RunDataReader ( dataReader ) ) ;
295294 }
296295 command . Parameters . Clear ( ) ;
297296 return entities ;
298297 }
299298
300- private List < JObject > MigrateEntities ( IEnumerable < JObject > entities , SqlConnection connection )
299+ private IEnumerable < JObject > MigrateEntities ( IEnumerable < JObject > entities , SqlConnection connection )
301300 {
302- return entities . Select ( entity => MigrateAndUpdate ( entity , connection ) ) . ToList ( ) ;
301+ return entities . Select ( entity => MigrateAndUpdate ( entity , connection ) ) ;
303302 }
304303
305304 private JObject MigrateAndUpdate ( JObject entity , SqlConnection connection )
0 commit comments