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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T00:10:42+00:00 2026-05-15T00:10:42+00:00

My friends were having discussion on nested lists of objects in LINQ and when

  • 0

My friends were having discussion on nested lists of objects in LINQ and when I asked what does that mean, they laughed 🙁

Can anyone here tell what is nested list. is it same like list inside list? Thank you to all who help me

Is this NestedList?

public class X
{
public Y[] y { get; set; }   
}

public class Y
{
int id { get; set; }
}
  • 1 1 Answer
  • 3 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-15T00:10:43+00:00Added an answer on May 15, 2026 at 12:10 am

    Yes, it sounds like a list inside a list, for example:

    List<List<int>>
    

    It wasn’t nice to laugh at you though – it may indicate your code is better organized into logical classes. Such constructs, in general, should be avoided – you probably wouldn’t want to expose or use an interface with too complicated types, but it is common to use such lists locally, specially when using LINQ.

    A simple example where this can be useful would be:

    string[] directories = Directory.GetDirectories("c:\\");
    var files = directories.Select(Directory.GetFiles).ToList();
    

    Here, files is a List holding an array of strings: List<string[]>, which is quite similar. It is very likely your friends weren’t talking about lists in particular, it is just as common you work with arrays, dictionaries, or IEnumerables.

    The posted code does not have nested, or two dimensional lists. X has a array of Y, and that’s it. If you has a list of Xs, however, that would have nested lists:

    IEnumerable<X> xfiles = GetXFiles();
    foreach(X file in xfiles)
    {
        foreach(Y section in file)
        {
            //...
        }
    }
    

    It comes down to a simple point: an object can hold other objects, with any complexity.

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

Sidebar

Related Questions

I was having a discussion with some programmer friends who said that they see
Dear Friends from Stackoverflow, Please help me with a problem that i'm having when
Friends I am having a String that contains date-record String date=10-Oct-2012 @12-Oct-2012 @$12-Oct-2012 @12-Oct-2012
Yo my friends having a coding error with his site, and asked me for
Hi im having trouble with this sql. Basically it displays statuses that my friends
I'm really having a time figuring this one out and can't find any friends
Friends how can i do the following? I am having three input fields <input
I'm designing an application that will benefit from having the user's Facebook friends suggested
Recently I was having a discussion with a friend about Ruby's Proc . You
I just created an iPhone app and am having friends try it out, but

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.