Entity Framework 6 or Core - Read query result with a "DataReader" like pattern

datareader entity-framework-6 entity-framework-core

Question

Is there a method to read an IQueryable result from a LINQ query on an EF DBContext as a "Typed Data Reader" without having to save the whole result in memory (for example, using a.ToList())?

I anticipate something like to (or comparable to) this:

var personQueryResult=dbContext.People.Where(…).Select(…).AsDataReader();
foreach(person in personQueryResult){
   //Here I expect that person is typed of the People Dbset<T> type, ex. a Person type and i can do:

person.Name="...";
person.Surname="...";
//etc.
}
1
0
8/13/2018 8:45:55 PM

Accepted Answer

ZZZ_tmp
1
8/16/2018 3:50:45 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow