Difference between LLBLGenProQuery and IQueryable

Posts   
 
    
vivek
User
Posts: 45
Joined: 06-Sep-2012
# Posted on: 13-Sep-2012 04:41:07   

Hi Guys,

Could anyone please desctribe the difference between LLBLGenProQuery Class and IQueryable? I am using LLBLgen Pro 3.5 and using LinqMetadata class and it's returning an object of LLBLGenProQuery. If they are same, then i don't need to worry. If not, then how do i type cast between them?

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 13-Sep-2012 07:54:28   

IQueryable<T> (ref) It's a query that will make the compiler produce code which creates at runtime a tree of Expression instances, representing the entire query, in short an Expression tree. An Expression tree is not executable directly, it has to be interpreted to execute what is specified inside the Expression tree. This is what a Linq provider, like Linq to LLBLGen Pro, does: it accepts an Expression tree, translates it into elements it can understand, interprets these elements and produces an executable form of this query.

ILLBLGenProQuery ( ref) An interface defined on the IQueryable<T> elements produced by LinqMetaData. This interface allows you to execute the query by calling the Execute method. The advantage of this is that you can get the query result in its native container, e.g. an entity collection. Another advantage is that to obtain a list of the results, the provider doesn't have to traverse the results in full, and copy over the results in a List: the returned results are already in the container they're initially stored in.

I hope that answer your question.

David Elizondo | LLBLGen Support Team