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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T05:30:18+00:00 2026-06-11T05:30:18+00:00

LINQ to objects is my best friend. I am using often the ConvertAll extension

  • 0

LINQ to objects is my best friend. I am using often the ConvertAll extension method to achieve a conversion.

However I realize I can achieve the same by using the Select extension method.

For example, I have a ListView that displays a list of Alarm objects. I store the object itself in the Tag property of a ListView element. Then I retrieve the selection this way :

Version with ConvertAll:

public Alarm[] SelectedTags
{
    get
    {
        return AlarmListView
               .SelectedItems
               .OfType<ListViewItem>()
               .ToList().ConvertAll(i => i.Tag as Alarm)
               .ToArray();
    }
}

Version with Select:

public Alarm[] SelectedTags
{
    get
    {
        return AlarmListView
               .SelectedItems
               .OfType<ListViewItem>()
               .Select(i => i.Tag as Alarm)
               .ToArray();
    }
}

Personally I prefer Select because I can convert my collections easily without having to put them in a List and use ConvertAll. Anyway, both have certainly good reasons to exists.

Is one better than the other ? In which scenarios ?

  • 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-11T05:30:20+00:00Added an answer on June 11, 2026 at 5:30 am

    ConvertAll has been around since .Net 2.0, whereas LINQ is newer. Select appears to be more general, and to make ConvertAll redundant.

    I can’t think of any situation where you would need to use ConvertAll in new code. Select is better-known, more general, and works with the other features of LINQ (such as direct translation to SQL queries in LINQ to SQL).

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

Sidebar

Related Questions

What is the best way to do a conditional query using linq to objects(not
I am using WCF to send some Linq objects across the wire. I want
Can we use Business Objects which we made & data acess Layer of LINQ?
How can I filter out objects based on their derived type with linq-to-objects? I
I wonder how LINQ to Objects determines the best way to query in a
I am using LINQ to Objects and wonder if it is possible to improve
I have a linq to objects query in a recursive loop and afraid when
see also Differences between LINQ to Objects and LINQ to SQL queries We are
I have a class containing Linq To SQL objects that are used to populate
In my repository layer I am mapping Linq-to-Sql objects to my application domain objects.

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.