Efficient retrieval of lists over WebServices

Posted by Chris on Stack Overflow See other posts from Stack Overflow or by Chris
Published on 2011-01-04T15:51:26Z Indexed on 2011/01/04 15:53 UTC
Read the original article Hit count: 165

Filed under:
|
|
|
|

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"

Thanks

© Stack Overflow or respective owner

Related posts about c#

Related posts about LINQ