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

  • Home
  • SEARCH
  • 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 4090996
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:18:35+00:00 2026-05-20T19:18:35+00:00

I just found out I’m not as fluent with delegate and action and the

  • 0

I just found out I’m not as fluent with delegate and action and the other one as I would want…

I have a certain IEnumerable<T> which I would like to transform to a IEnumerable<object> using a delegate function that creates object as an anonymous object. An extension method would come in handy here or might already exist?

This (or something like this) should be possible right?

IEnumerable<SomeBllObject> list;
IEnumerable<object> newList = list.Transform(x => return new {
                        someprop = x.SomeProp, 
                        otherprop = x.OtherProp
                  });
  • 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-20T19:18:36+00:00Added an answer on May 20, 2026 at 7:18 pm

    If you’re using .NET 4, you’ve just described the Select method:

    IEnumerable<object> newList = list.Select(x => new {
                            someprop = x.SomeProp, 
                            otherprop = x.OtherProp
                      });
    

    For .NET 3.5 you’d need to cast the result of your delegate, as it doesn’t have generic covariance:

    IEnumerable<object> newList = list.Select(x => (object) new {
                            someprop = x.SomeProp, 
                            otherprop = x.OtherProp
                      });
    

    Or use implicitly typed local variables and get a strongly typed sequence:

    var newList = list.Select(x => new {
                            someprop = x.SomeProp, 
                            otherprop = x.OtherProp
                      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just found out that the video output of the iPad is not a system
I just found out that Java allows enums to implement an interface. What would
I just found out this today: If I have an existing file named a111,
Just found out what Ajax is, and I want to build a simple Ajax/Jquery
I just found out how to have help open and the code editor open
I just found out about PHPIDS and I have a couple of questions: Can
I have just found out the function strftime() . The manual says about it:
I have information stored in a session. But was I just found out, sessions
I just found out that onchange event does not bubble in MSIE. I hopped
Just found out that when I pressed up in my cmd one of my

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.