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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:55:51+00:00 2026-05-26T06:55:51+00:00

dynamic model = new ExpandoObject(); model.Data = "asdf"; List<dynamic> listOfx = new List<dynamic>(); for

  • 0
dynamic model = new ExpandoObject();
model.Data = "asdf";

List<dynamic> listOfx = new List<dynamic>();
for (int i = 0; i < 3; i++) {
    dynamic x = new ExpandoObject();
    x.ID = i;
    x.Name = "test" + i.ToString();
    listOfx.Add(x);
}
model.listOfx = listOfx;

When I run this, I can see Data inside model, but not listOfx.

Problem: how to get a list(or IEnumerable) inside an ExpandoObject

UPDATE on Solution:
enter image description here

Because I couldn’t see the lifOfx in the locals window I thought it wasn’t working. Here (through y) you can see it is. 🙂

  • 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-26T06:55:52+00:00Added an answer on May 26, 2026 at 6:55 am

    I can’t reproduce similar issues on Mono 2.10:

    using System.Dynamic;
    using System.Collections.Generic;
    
    using System;
    
    public class Program
    {
        public static void Main(string[] args)
        {
            dynamic x = new ExpandoObject();
            x.Data ="test";
            x.Arr = new [] { "test1","test2"};
            x.Lst = new List<string> { "aap", "noot", "mies" };
    
            Console.WriteLine(string.Join(", ", x.Arr));
            Console.WriteLine(string.Join(", ", x.Lst));
        }
    }
    

    Output:

    /tmp @ dmcs test.cs && mono test.exe
    test1, test2
    aap, noot, mies
    

    I’ll be retesting on windows shortly.

    Update have tested the following:

    • the linux-compiled (dmcs) binary run on Windows with Mono 2.10: OK
    • the linux-compiled (dmcs) binary run on Windows with MS.NET 4.0: OK
    • the windows-compiled (dmcs) binary run on Windows with Mono 2.10: OK
    • the windows-compiled (dmcs) binary run on Windows with MS.NET 4.0: OK
    • the windows-compiled (csc.exe) binary run on Windows with Mono 2.10: OK
    • the windows-compiled (csc.exe) binary run on Windows with MS.NET 4.0: OK

    On linux I have only tested the binary compiled by mono itself, but I don’t anticipate any problems. Perhaps there is something subtly different about storing dynamics inside the List<>, I’ll test that now

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

Sidebar

Related Questions

I have created a Dynamic Data site against an Entity Framework Model I have
Dynamic Data question: I have 2 fields of type Nullable<DateTime> on my model When
I'm trying to use Dynamic Data with a entity model that has Abstract class
Dynamic allocations with new/delete are said to take place on the free-store , while
Dynamic Query is a single C# file you add to your project. Anyone know
When I originally created a Dynamic Data project I told it to expose the
I've added in the Dynamic Data stuff to our existing website, and gotten that
I'm planning a WPF application which will be able to create dynamic data entry
As the sole developer of an app, would using a dynamic model, or the
I am using MVC 3 w/ Razor and using the new dynamic ViewBag property.

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.