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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T23:53:35+00:00 2026-06-01T23:53:35+00:00

I have a WCF service with functions that return lists, such as one to

  • 0

I have a WCF service with functions that return lists, such as one to return a list of customers

[OperationContract]
IList<Customer> GetCustomers();

My ASP.NET page may do:

var top10Customers = Model.GetCustomers().Take(10);
var first10Customers = Model.OrderBy(c => c.ID).Take(10);

It is my understanding that the following code woulld return all Customers from the WCF service and THEN apply OrderBy and Take(10)

It seems inefficient to return the entire data set in one go, especially as the WCF service may reside on a different machine to the ASP.NET website. In which case how best can I page the results set or allow LINQ operations on it?

The only option I can see at the minute is to add paging options to the function, but this seems inefficient to re-write this code all the time:

[OperationContract]
IList<Customer> GetCustomers(int from, int numResults);
  • 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-06-01T23:53:37+00:00Added an answer on June 1, 2026 at 11:53 pm

    I’d suggest adding the parameters to the GetCustomers method and then execute the LINQ on that side in order to generate the most efficient SQL?

    [OperationContract] 
    IList<Customer> GetCustomers(int fromRecoard, string orderBy); 
    

    The order by will be a little trick, since you’ll need to convert from a sting into a lamda expression and use the property of Customer, but there are plenty of samples on the web.

    For more info on IQueryable in .Net 4.5 have a look at this blog post under the OData section.

    http://www.davidhayden.me/blog/asp.net-mvc-4-web-api-routes-and-apicontroller

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

Sidebar

Related Questions

I have a WCF service that has methods to return IEnumerable<T> collections of objects,
I have a WCF Service as a proxy that calls a WebClient to return
I have a WCF service that I have to reference from a .net 2.0
I have a WCF service, hosted in IIS 7.0 that needs to run database
I have a WCF Service that should not enter the faulted state. If there's
I have a simple WCF service application which contains a list of room items
I have a per-call WCF service that serves a number of clients. I'm looking
I have created an Ajax enabled WCF web service that contains this simple method:
I have a RESTful WCF service (.NET 3.5), which has a function that is
I have a asmx web-service that returns a list of countries for a continent.

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.