More in this section
Forums / Developing with Sitefinity / Is it possible to write a custom provider using a DAL that does not support IQueryable

Is it possible to write a custom provider using a DAL that does not support IQueryable

The forums are in read-only mode. In case that you want to directly contact the Progress Sitefinity team use the support center. In our Google Plus group you can find more than one thousand Sitefinity developers discussing different topics. For the Stack Overflow threads don’t forget to use the “Sitefinity” tag.
2 posts, 0 answered
  1. David
    David avatar
    99 posts
    06 Sep 2012
    25 Aug 2014
    Link to this post

    All of the providers that Sitefinity use contain at least one method that returns an IQueryable object. Is there any way I can write a custom provider if my DAL does not support IQueryable? 

  2. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    19 Apr 2017
    28 Aug 2014
    Link to this post
    Hello David,

    Unfortunately, the membership provider and the other providers use IQueryable when getting collection of items, in order to be able to filter it later on. The provider has to be implemented using queryable collections since the derived classes and interfaces need them. The MembershipDataProvider we have provided is made the way it is, so we ensure if you override the methods we can provide all the functionality working as expected and as the default membership provider. You can use the AsQueryable extension method on the queried collection, however, since all items are loaded this will slow down performance. You can see from our full code sample that we have also done this in some of the methods where this is inevitable.

    Nikola Zagorchev
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
2 posts, 0 answered