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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:30:54+00:00 2026-05-22T01:30:54+00:00

I am attempting to iterate an IEnumerable of an object using LINQ, and pull

  • 0

I am attempting to iterate an IEnumerable of an object using LINQ, and pull out a certain property of every object into an IEnumerable of the type of that property.

I am currently doing it with the SelectMany LINQ expression, but instead of returning an IEnumerable<string> which I want (as the property is a string), it is returning an IEnumerable<char>

var propertyValues = objectCollection.SelectMany(o => o.Value);

What am I missing?

  • 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-22T01:30:55+00:00Added an answer on May 22, 2026 at 1:30 am

    If it is returning an IEnumerable<char> then that is what it is. At a guess you want to use Select() and not SelectMany(), I would guess it is flattening a bunch of strings as an IEnumerable<char>. If you can post more code that shows what is in objectCollection we might be able to help more.

    EDIT

    bit more code to illustrate my point

    List<string> stringList = new List<string>();
    stringList.Add("string1");
    stringList.Add("string2");
    IEnumerable<char> chars = stringList.SelectMany(x => x);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Attempting to print out a list of values from 2 different variables that are
I am attempting to iterate through a HTML table using jQuery and delete empty
I am attempting to use snakeYAML to load a YAML file into an object
I am attempting to rewrite some code that was using FileSearch for Excel 2003
Attempting to insert an escape character into a table results in a warning. For
Attempting to make a NSObject called 'Person' that will hold the login details for
Attempting to use XStream's JavaBeanConverter and running into an issue. Most likely I'm missng
I'm attempting to iterate over the ListViewDataItems in an ASP.Net ListView, and use the
I am attempting at embedding multi-threading for the first time ever and running into
I am attempting to load up an entire array of NSManagedObjects into an NSArray,

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.