query.Skip(page*pageSize).Take(pageSize);However, after some research I realized that this is inefficient and actually causes some issues because the query is performed in memory.
N.B. Sitecore uses a reduced set of Linq operators, be careful when refactoring Sitecore Linq statements as tools like reSharper will break Sitecore Linq statements
Instead the Sitecore suggested approach to do this is to use the Page extension method, that is part of the QueryableExtension class in Sitecore.Contentsearch.Linq.
The above would become:
query.Page(page, pageSize);Much neater!
wonderful information, I had come to know about your blog from my friend nandu , hyderabad,i have read atleast 7 posts of yours by now, and let me tell you, your website gives the best and the most interesting information. This is just the kind of information that i had been looking for, i'm already your rss reader now and i would regularly watch out for the new posts, once again hats off to you! Thanks a ton once again,
ReplyDeleteRegards, sitecore training in hyderabad
Hi Nasreen, thanks for your nice comments!
ReplyDelete