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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:11:26+00:00 2026-05-27T10:11:26+00:00

I have a multithreaded app that is creating a list of strings on a

  • 0

I have a multithreaded app that is creating a list of strings on a BlockingCollection queue, I want to take that list of strings and convert it to a collection of item objects in one or 2 steps

Is it possible to create a func<> or lamda method to achieve this type of result

 public class item
{
    public string name { get; set; }

    public item(string nam)
    {
        name = nam;
    }


}

IList<string> alist = new string[] {  "bob","mary"};

Where you take a Ilist<> or IEnumerable<> of type string and return IList

So for the single item Func<>

Func<string, item> func1 = x => new item(x);

But essetially the signiture would look like

Func<IEnumerable<string>,IList<item>> func2 = x=> x.ForEach(i => func1(i));

Am I trying to put a round peg in sqaure hole or is my syntax/logic just wrong

Thanks in advance

  • 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-27T10:11:27+00:00Added an answer on May 27, 2026 at 10:11 am

    You will have to use a Select projection instead of ForEach and then convert the resulting IEnumerable<item> to a list using ToList() – this should work:

    Func<IEnumerable<string>,IList<item>> func2 = x => x.Select( i => new item(i)).ToList();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a multithreaded app that uses sqlite. When two threads try to update
I have a multithreaded app that has to read some data often, and occasionally
I'm building a multithreaded app in .net. I have a thread that listens to
I have a basic queue of tasks executing (c# WinForms App that talks to
I have a multi threaded .NET app that uses async I/O and AsyncCallbacks to
I have a multithreaded .NET Windows Service that hangs intermittently -- maybe once every
I have a multithreaded application that has many concurrent operations going on at once.
Let's say I have a multithreaded C++ program that handles requests in the form
I have a graphical control that is multithreaded. Until now it worked fine, but
I have a multi-threaded app that uses Core Data. I've been seeing a lot

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.