+1-888-365-2779
Try Now
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

2 posts, 0 answered
  1. David
    David avatar
    99 posts
    Registered:
    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
    Registered:
    24 Nov 2016
    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.

    Regards,
    Nikola Zagorchev
    Telerik
     
    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