Please see this line of code. This is an invocation of a stored procedure, which returns an ObjectResult. In order to extract the long values I add
Working on an IEnumerable means that all further operations will happen in C# code, i.e. linq-to-objects. It does not mean that the query has already executed.
Once you degrade to linq-to-objects all data left at this point needs to be fetched from the database and sent to .net. This can degrade performance drastically(For example database indexes won't be used by linq-to-objects), but on the other hand linq-to-objects is more flexible, since it can execute arbitrary C# code instead of being limited by what your linq provider can translate to SQL.
A IEnumerable can be both a deferred query or already materialized data. The standard linq operators typically are deferred, and ToArray()/ToList() are always materialized.