Tuesday, August 16, 2011

What are Interpreted Queries?


LINQ combines two architectural models: in-memory local and remote.
The first one is basically LINQ-to-Objects and LINQ-to-XML. Local model closely work withIEnumerable<T> and decorator sequences of C# methods, lambdas and delegates. The query is compiled into standard imperative IL code.
The second one is LINQ-to-SQL and LINQ-to-Entities. Remote model in contrast is rather declarative to the runtime. Sequences in query implement the IQueryable<T> (which in turn derives fromIEnumerable<T>) and after the compilation resolve into query operators from Queryable class – expression trees. Depending on the query provider, expression trees will be later interpreted by the runtime and are “friendly” to the remote data source

No comments:

Post a Comment