QuerySpec DataBinding

Posts   
 
    
Isz
User
Posts: 108
Joined: 26-Jan-2006
# Posted on: 16-May-2012 02:13:04   

Hello,

Still new to QuerySpec, and so far I am thankful that it has just overcome a correlated subquery issue where LINQ seemed to fail (I'm certain it has to do with one of Fran's primary issues with LINQ).

Problem: I'm trying to traverse the documentation so forgive me if this question is already answered. How would QuerySpec be used in a Databinding scenario where characteristics like Paging, Filtering, Sorting, Grouping are generally handled under the hood?

Background: With an IQueryable<T>, a LinqDataSource, and a grid (like Telerik's in this case, but doesn't usually matter), paging is passed to the queryable before any SQL is invoked, and there is no need for me to provide method overloads, or other special handling for paging to "just work". Also, I don't explicitly need to call ToList(), or apparently in context of QuerySpec, call adapter.FetchQuery(q); but now it appears this would be necessary.

Also, I thought I spotted that the IQueryable can be used with the DynamicQuery<T>/EntityQuery<T> but I lost that reference.

Generally speaking, I prefer POCO-style objects so my UI does not require knowledge of Entity2 or even DataAccessAdapter, hopefully with QuerySpec, I can continue this approach.

Thanks for any feedback you may have!!!

daelmo avatar
daelmo
Support Team
Posts: 8245
Joined: 28-Nov-2005
# Posted on: 16-May-2012 08:03:36   

Isz wrote:

Problem: I'm trying to traverse the documentation so forgive me if this question is already answered. How would QuerySpec be used in a Databinding scenario where characteristics like Paging, Filtering, Sorting, Grouping are generally handled under the hood?

Background: With an IQueryable<T>, a LinqDataSource, and a grid (like Telerik's in this case, but doesn't usually matter), paging is passed to the queryable before any SQL is invoked, and there is no need for me to provide method overloads, or other special handling for paging to "just work". Also, I don't explicitly need to call ToList(), or apparently in context of QuerySpec, call adapter.FetchQuery(q); but now it appears this would be necessary.

QuerySpec and Linq2Llbl uses the LLBLGen API under the hood. To do databinding directly with Entities you could use the LLBLGenProDataSource. There is no direct support for IQueryable or EntityQueries when you use LLBLGenProDataSource or any other datasource, you should pass the final collection to the grid datasource or use LLBLGenProDatasource with livePersistence = false and use the event handlers. Example for linqMetaData: http://www.llblgen.com/TinyForum/Messages.aspx?ThreadID=18553

Isz wrote:

Also, I thought I spotted that the IQueryable can be used with the DynamicQuery<T>/EntityQuery<T> but I lost that reference.

You can't use IQueryable with QuerySpec.

David Elizondo | LLBLGen Support Team