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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:57:45+00:00 2026-05-15T00:57:45+00:00

When we call a query operator on a sequence, a sequence-specific operator gets called.

  • 0

When we call a query operator on a sequence, a sequence-specific operator gets called.
I mean if i call Where<>() operator on IEnumerable<>, the operator that will be called will be defined in Enumerable class and if it’s called on IQueryable<>, the one defined in Queryable class will be called.

Consider the operator Reverse, defined in the Enumerable class.
If i want to call it on Iqueryable<> then I must use the AsEnumerable<>() operator to first convert it into IEnumerable<>.

db.Countries.OrderBy(cntry=>cntry.CountryName).AsEnumerable().Reverse()

But the Reverse operator got to have all records at the same time so that it can reverse them.
In the above code do all the records get loaded in memory first and then the Reverse() operator is reversing it ?

  • 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-15T00:57:45+00:00Added an answer on May 15, 2026 at 12:57 am

    IQueryable<T> extends IEnumerable<T>, so the AsEnumerable is redundant. However, if you use it, AsEnumerable is not going to greedily load the collection (that would be a very annoying “feature”). Clearly, Reverse will need the whole thing. Mono implements Enumerable.Reverse using a List<T> and a simple iterator-generator that yields in reverse.

    I believe the only real purpose of AsEnumerable is to force the use of IEnumerable explicit interface implementations.

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

Sidebar

Related Questions

I'd like to call a query with a field name filter that I wont
I have a coldfusion cfc that i call to query events between the start
How can I call dojo.query with button on my page so that I save
I call SQLiteDatabase.query and get a Cursor. While I'm still iterating over that cursor,
I have MongoJS query call: db.users.find({username:eleeist},function(err, docs) { console.log(docs); }); The docs variable looks
I have a dynamic query which I call and I put the Result set
I'd rather not make a call to the database to query @@IDENTITY. Is there
I need to write what I'd like to call a Valley Girl-query. I need
I call from a spreadsheet module a function that does some processing in another
I am making a query call to freebase and I receive a JSON response.

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.