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

  • Home
  • SEARCH
  • 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

Ask A Question

Stats

  • Questions 85k
  • Answers 85k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer They're source-level metadata. They're a way of adding information to… May 11, 2026 at 5:11 pm
  • Editorial Team
    Editorial Team added an answer Generally the comments we do where I work are a… May 11, 2026 at 5:11 pm
  • Editorial Team
    Editorial Team added an answer I've found an answer that is applicable if you've installed… May 11, 2026 at 5:11 pm

Related Questions

I'm developing a SOAP application that integrates with a 3rd party. I think the
I am developing an application which will be connected to Access database at the
I am developing an .net application which heavely depends on plugins. The application itself
I am developing an application for pocket PC which should run in landscape mode.
I am developing an application using asp.net 2.0 (C#), in which I am trying

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.