Note that there are some explanatory texts on larger screens.

plurals
  1. POImplementing pager through WCF service
    primarykey
    data
    text
    <p>I am developing an application which includes a WCF service and its ASP.NET MVC client. The ASP.NET MVC website must display a grid of objects - say, products. These products are stored in database which is accessible through the WCF service. So somewhere inside an MVC controller I call WCF service's method that returns me an array of products that I need to display.</p> <p>So what is my question? I want to implement a pager functionality for my products grid, because it is possible that there will be a lot of products. So there are several ways to do that:</p> <ol> <li>My controller can get the whole list of products and just do in-memory paging</li> <li>WCF can select all the products and store them somewhere in its cache, then pass to the controller only part of them, according to the requested page number.</li> <li>WCF can select only part of the products from the database, according to the requested page number.</li> <li>WCF can return IQueryable to the controller, and then the controller will select whatever he wants whenever he wants.</li> </ol> <p>As far as I understand (and correct me if it is not true), the first option is useless, so I must choose between the others. </p> <p>The second option wastes my server's memory. </p> <p>The third option is OK, but it seems a little bit ugly to implement paging on the WCF side. </p> <p>And the fourth option sounds confusing. I actually pass some kind of query to the client, and then he queries my database by himself, through the WCF service. I can't figure out how to implement this correctly.</p> <p>So can you please help me to choose the correct way to implement this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload