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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:45:18+00:00 2026-05-14T15:45:18+00:00

The MSDN library entry to Enumerable.ElementAt(TSource) Method says If the type of source implements

  • 0

The MSDN library entry to Enumerable.ElementAt(TSource) Method says

“If the type of source implements
IList, that implementation is used
to obtain the element at the specified
index. Otherwise, this method obtains
the specified element.”

Let’s say we have following example:

        ICollection<int> col = new List<int>() { /* fill with items */ };
        IList<int> list = new List<int>() { /* fill with items */ };

        col.ElementAt(10000000);
        list.ElementAt(10000000);

Is there any difference in execution? or does ElementAt recognize that col also implements IList<> although it’s only declared as ICollection<>?

Thanks

  • 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-14T15:45:19+00:00Added an answer on May 14, 2026 at 3:45 pm

    The type of the variable itself is irrelevant to the ElementAt method – as far as it’s concerned, it’s only declared as IEnumerable<T>, because that’s what the parameter type is. (Both calls will be bound to the same extension method.)

    It’s the execution-time type of the object which is tested in ElementAt.

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

Sidebar

Related Questions

http://msdn.microsoft.com/en-us/library/system.double.epsilon.aspx If you create a custom algorithm that determines whether two floating-point numbers can
The MSDN library lists the await keyword as an operator . That seems strange
http://msdn.microsoft.com/en-us/library/ms731379.aspx says value of maxConcurrentSessions is by default 10 where as http://msdn.microsoft.com/en-us/library/system.servicemodel.description.servicethrottlingbehavior.maxconcurrentsessions.aspx says its
http://msdn.microsoft.com/en-us/library/ms189797.aspx In this link they are committing a transaction within catch clause IF (XACT_STATE())
http://msdn.microsoft.com/en-us/library/dd997415.aspx Per the article referenced above I am trying to handle exceptions in a
http://msdn.microsoft.com/en-us/library/hh680905(v=pandp.50).aspx Transient Fault Handling gives the ability to handle connection errors etc. SaveChangesWithRetries() says
From http://msdn.microsoft.com/en-us/library/system.math.pow.aspx int value = 2; for (int power = 0; power <= 32;
According to http://msdn.microsoft.com/en-us/library/ms810291.aspx , you can't change the ReadOnly attribute of an Expression based
According to MSDN ( http://msdn.microsoft.com/en-us/library/system.windows.forms.label.autosize.aspx ), there's a note about Label 's AutoSize property:
Following the article at http://msdn.microsoft.com/en-us/library/ee554869(office.14).aspx I tried to setup development environment for SharePoint 2010

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.