I have a WCF WebService that uses LINQ and EF to connect to an SQL database. I have an ASP.NET MVC front end that collects its data from the webservice.
It currently has functions such as
List<Customer> GetCustomers();
As the number of customers increases massively the amount of data being passed increases also reducing efficiency. What is the best way to "page data" across WebServices etc.
My current idea is to implement a crude paging system such as
List<Customer> GetCustomers(int start, int length);
This, however, means I would have to replicate such code for all functions returning List
types. It is unfortunate that I cannot use LINQ as it would be much nicer.
Does anyone have any advice or ideas of patterns to implement that would be "as nice as possible". Also how would one cope with such things as ordering. I.e. if I want to order by a specific parameter I would have to implement something bespoke for each type which seems wasteful.
Thanks