1

This may be duplicate question but I could not find one on SO. If so Please point me to the one.

I have seen many examples of Paging and Sorting using IQueryable all fine, but, I dont want to use IQueryable or at least not from outside Repository ( not expose it outside).

I am not using Linq To SQL. My Repository currently returns DTO or ICollection.

I am using JqGrid. I don't want to bring down all data at one time.

As my application is current in development I bring all data and then do Paging, orderBy , SKIP, where etc.. in controller.

what I would Like is to have these operation done at Database Level (where I believe it will be more efficient as size of database increases).

Any suggestions on how I should go about implementing Paging , Sorting and Filtering

Regards,

Mar

1 Answer 1

3

If your using your own DAL then I'm not sure what kind of advice somebody could give. 99% of paging is what you do in the data layer. The rest is simply using url variables to send these commands down to the data layer.

Usually Browse/Grid/Collection/Bulk actions are something like this:

public ActionResult Browse( string search, int page, string sortedBy )
{
      var dataz = MyDAL.GetResults( search, page, sortedBy );
} 

The rest is up to you really.

Sign up to request clarification or add additional context in comments.

1 Comment

I agree with you. I think I was unnecessarily looking to complicate things by implementing pagination, filtering ... library like Ipagination for my DataAccess layer. Looking further into it I will for now stick with the way you have described above (or till I can ask a clearer question :-))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.