I understand that if I call the code below, will query data from the database and return the actual object in locally in memory. After calling this code, the later manipulation of the list will not calling to the database again:
db.Context.Where(...).ToList()
If I don't use ToList with only Where or with Select call, it will return a IQueryable<> object.
var data = db.Context.Where(...).Select (...) or db.Context.Where(...);
Does that mean, the method not yet call database to fetch the data, until I call ToList, First() etc...
foreach (var a in data)
{
var b = a.SomeCollection.ToList()
}