At compile time, LINQ statements working in IQueryable<T> operations (thus Linq-to-SQL and Linq-to-Entities) are converted to expression tree objects that represent code as data.
a) LINQ operations that work on IEnumerable<T> (thus LINQ-to-Objects) are also converted to expression trees?
b) If not, what happens to LINQ-to-Object statements at compile time? Does the compiler just translate them into the corresponding method calls? For example, this is the following Linq-to-Objects statement:
var results = collection.Select(item => item.id).Where(id => id > 10);
translates by the compiler into something similar to the following:
var results = Enumerable.Where( Enumerable.Select(collection, item => item.id), id => id > 10 );
Thank you
linq-to-objects
AspOnMyNet
source share