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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T00:07:08+00:00 2026-05-24T00:07:08+00:00

I have the following method, which works perfectly. //private static IEnumerable<object> movieSequence; private static

  • 0

I have the following method, which works perfectly.

//private static IEnumerable<object> movieSequence;
private static void DeferredExecution()
{
    var movieSequence = new[] {
                            new {Name="Harry potter", Genre="Action/Thrill", ReleasedYear=2011, Price=24.0},
                            new {Name="Tooth fairy", Genre="Family", ReleasedYear=2010, Price=20.5},
                            new {Name="How to train your dragon", Genre="Family", ReleasedYear=2010, Price=20.5}
                        };
    double priceMultiplier = 0.5;

    var newPriceList = movieSequence.Select(movie => new
    {
        Name = movie.Name,
        Genre = movie.Genre,
        ReleasedDate = movie.ReleasedYear,
        Price = movie.Price * priceMultiplier
    });

    foreach (var movie in newPriceList)
    {
        Console.WriteLine("{0} ({1}) costs ${2}", movie.Name, movie.ReleasedDate, movie.Price);
    }
}

But, I want to extend the scope of movieSequence. Since it is of anonymous array type, its type couldn’t be pin pointed.

IEnumerable doesn’t work since T can’t be specified, object in place of T couldn’t bring movie.Name, movie.Genre etc.

Non-generic IEnumerable doesn’t have Select extension.

IList, ICollection (parents of array) etc. doesn’t have Select extension. Obviously “var” is not an option at the class level.

What could be the possible type?

  • 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-24T00:07:10+00:00Added an answer on May 24, 2026 at 12:07 am

    I think (haven’t tried it) you could use dynamic[] + IEnumerable<dynamic> instead of just [] + IEnumerable<object>, but I’ll advise against it. Much better to actually build a type for your objects.

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

Sidebar

Related Questions

I have the following method which serialises an object to a HTML tag. I
I have the following ajax call which works perfectly in Firefox and Chrome but
I have the following code which works: ViewBag.Resources = New SelectList(db1.Tbl_Resources, Resource_ID, Resource_FirstName) I
Imagine I have the following: private IEnumerable MyFunc(parameter a) { using(MyDataContext dc = new
I have the following code which works just fine when the method is POST,
I have following method which I am using to load ActiveX control dynamically, Dim
I have the following method which is called when the value Edit Class... is
I have the following method which is not capturing anything from the user.If I
I have the following delegate method which is listening for when text changes in
I have the following method, which takes in the name of a file as

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.