I have a LINQ TO SQL Context that I have created that calls a stored proc. When I'm looping through the ISingleResult is it creating entities on the fly while the underlying DataReader reads the results or does it put every thing into Entities upfront before the function call returns.
Basically what is going on is I'm working with a stored proc that may sometimes return 10's of thousands of records while most of the time it only returns a few thousand records.
DatabaseDataContext context = new DatabaseDataContext();
var resultSet = context.MyStoredProc();
foreach (var result in resultSet)
{
// some code here
}
Would that that load every thing into memory at once or would it be loaded one at a time while I loop through it??