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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:38:39+00:00 2026-06-09T14:38:39+00:00

i use lots of extension methods like .ToList() and .Reverse() etc without really thinking

  • 0

i use lots of extension methods like .ToList() and .Reverse() etc without really thinking about what really happens under the covers when i use them. I’ve been searching on google to find out what exactly these methods do, but i can’t seem to find them anywhere. When i use a .toList() in visual studio and i click on “Go to definition” all i see is

         // Summary:
        //     Creates a System.Collections.Generic.List<T> from an System.Collections.Generic.IEnumerable<T>.
        //
        // Parameters:
        //   source:
        //     The System.Collections.Generic.IEnumerable<T> to create a System.Collections.Generic.List<T>
        //     from.
        //
       ...etc

im trying to find out what’s going on inside the (for instance) .Reverse(); method. Does it use a stack, does it simply do something like this … ?

public static List<string> Reverse(List<string> oldList)
{
List<string> newList = new List<string>();    
for (int i = oldList.Count-1; i >= 0; i --)
    {
    newList.Add(oldList[i]);
    }
    return newList;
}

Note: i can’t imagine it’d actually be something like this, but just to clarify my question.

Is there any site/book/whatever that i can check out that shows what exactly these methods do ?

  • 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-09T14:38:40+00:00Added an answer on June 9, 2026 at 2:38 pm

    You can configure Visual Studio to load the source code of .Net Framework from Microsoft source servers, when you click ‘Go to Definition’. Here are some instructions: http://referencesource.microsoft.com/downloadsetup.aspx

    Note that you don’t have to download the big package, just setting up the options is enough.

    Here is the source code of ToList:

        public static List<TSource> ToList<TSource>(this IEnumerable<TSource> source) { 
            if (source == null) throw Error.ArgumentNull("source");
            return new List<TSource>(source); 
        } 
    

    And here is the source code of Reverse:

        public static IEnumerable<TSource> Reverse<TSource>(this IEnumerable<TSource> source) {
            if (source == null) throw Error.ArgumentNull("source"); 
            return ReverseIterator<TSource>(source);
        }
    
        static IEnumerable<TSource> ReverseIterator<TSource>(IEnumerable<TSource> source) { 
            Buffer<TSource> buffer = new Buffer<TSource>(source);
            for (int i = buffer.count - 1; i >= 0; i--) yield return buffer.items[i]; 
        } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really like py.test , but I am having lots of difficulty understanding how
In my current project, we use lots of user controls. Large user controls (500+
In terms of performance and efficiency, is it better to use lots of small
Lots of times when I use an application that needs perforce access (Visual Studio,
People use gdb on and off for debugging, of course there are lots of
I'm developing a library for use in other apps and this library has lots
I do use lots of AsyncTasks within Activities as private inner classes. One thing
I use lots of transparent buttons in my apps. The button graphical area is
Apart from code readability, why is it bad to use lots of if statements?
I realize a lot of questions like 'what cms should I use / what

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.