I know of several LINQ statements that will cause EF to evaluate and return results form the DB to memory. .ToList() is one. Does anyone have a comprehensive
From MSDN,
Queries that perform aggregation functions over a range of source elements must first iterate over those elements.
Examples of such queries are Count, Max, Average, and First. These execute without an explicit foreach statement because the query itself must use foreach in order to return a result.
Note also that these types of queries return a single value, not an IEnumerable collection.
To force immediate execution of any query and cache its results, you can call the ToList
or ToArray methods.