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 3961300
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:57:31+00:00 2026-05-20T02:57:31+00:00

We have been working with various versions of the PagedList , however these pagedlists

  • 0

We have been working with various versions of the PagedList , however these pagedlists are not Wcf friendly. They do not serialize. Does anyone have a good way to get paged data across Wcf? (Including properties such as TotalRecords of the datasource.)

  • 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-20T02:57:32+00:00Added an answer on May 20, 2026 at 2:57 am

    We worked out a solution to simplify the current PagedList to something that is more serializable and a little more geared to our solution. Instead of creating a custom List/Collection, we created a class that contains the list/collection.

    Previously we were losing the custom properties of the pagedlist when it was deserialized on the client side. It still had all the items in the list, but it was missing the properties.

    This is based on code by Troy Goode which I believe is based on some unreleased Microsoft MVC code. More info can be found here: http://www.squaredroot.com/2009/06/15/return-of-the-pagedlist/

     public class PagedList<T> : IPagedList<T>
        {
            public PagedList()
            {
            }
    
            public PagedList(IEnumerable<T> source, int pageIndex, int pageSize)
                : this(source == null ? new List<T>().AsQueryable() : source.AsQueryable(), pageIndex, pageSize)
            {
            }
    
            private PagedList(IQueryable<T> source, int pageIndex, int pageSize)            
            {
                TotalRecords = source.Count();
    
                // add items to internal list
                if (TotalRecords > 0)
                    if (pageIndex == 0)
                        Data = source.Take(pageSize).ToList();
                    else
                        Data = source.Skip((pageIndex) * pageSize).Take(pageSize).ToList();
            }
    
            public int TotalRecords { get; set; }
    
            public IEnumerable<T> Data { get; set; }
        }
    

    and then the actual implementation through the following extension:

    public static PagedList<T> ToPagedList<T>(this IEnumerable<T> source, int pageIndex, int pageSize)
    {
        return new PagedList<T>(source, pageIndex, pageSize);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

GAE 1.5.5 looks to have some excellent, long-waited for features. However, they're not working
I've been working with about a dozen WCF Services that have been deployed to
I have been working on Neural Networks for various purposes lately. I have had
i have been working on this text extraction project of various file extensions, but
I'm still learning iOS development and have been working with various tutorials and books.
Have been working on this question for a couple hours and have come close
I have been working with SQL Server as a Developer a while. One thing
I have been working on a large java application. It is quite parallel, and
I have been working on this app for at least 3-4 months and just
I have been working on a project in C# (.net4). Project pretty much allows

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.