Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 188877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:07:31+00:00 2026-05-11T16:07:31+00:00

I am developing an application which includes a WCF service and its ASP.NET MVC

  • 0

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.

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:

  1. My controller can get the whole list of products and just do in-memory paging
  2. 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.
  3. WCF can select only part of the products from the database, according to the requested page number.
  4. WCF can return IQueryable to the controller, and then the controller will select whatever he wants whenever he wants.

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.

The second option wastes my server’s memory.

The third option is OK, but it seems a little bit ugly to implement paging on the WCF side.

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.

So can you please help me to choose the correct way to implement this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:07:32+00:00Added an answer on May 11, 2026 at 4:07 pm

    What is your back-end database layer look like? If you’re using LINQ (-to-SQL or -to-Entities), you could implement paging through WCF by specifying the page size and the page number you want, and then use LINQ’s “Skip” and “Take” operators to fetch the page requested – something roughly like:

    [ServiceContract]
    public interface IFetchData
    {
      [OperationContract]
      public List<Data> GetData(int pageSize, int pageNumber)
    }
    

    and then implement it something like this (simplified):

    public class FetchDataService : IFetchData
    {
      public List<Data> GetData(int pageSize, int pageNumber)
      {
          var query = yourContext.DataTable
                        .Skip((pageNumber - 1) * pageSize)
                        .Take(pageSize);
    
          return query.ToList();
      }
    }
    

    Would that be helpful for you??

    Marc

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing an .net application which heavely depends on plugins. The application itself
I am developing a Cocoa application which communicates constantly with a web service to
We've been developing an Android application which includes Google Adsense. However there seems to
When developing a web application using ASP.NET, do you have any hints about how
I'm currently developing an application for a company which includes livescoring. The XML-files I
I was working on a project which includes developing an application using java sockets.
I am developing an application which will be connected to Access database at the
I'm developing an application which has a lot of text and also different modules
I'm developing an application which currently have hundreds of objects created. Is it possible
I am developing a web application which has Chart Controls. I have developed a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.