title: Iterating and creating new anonymous types dynamically
body: <p>I have an anonymous type of this form:</p>
  
  <pre><code>new List&lt;MyList&gt;()
  {
     new Column { Name = "blah", Width = 100, Hidden = true },
     new Column { Name = "blah1", Width = 60, Hidden = false }
  } 
  </code></pre>
  
  <p>How can I go about creating the content within the list dynamically, like:</p>
  
  <pre><code>new List&lt;MyList&gt;()
  {
      foreach (var columns in col) 
      {
         new Column { Name = columns.Name ... }
      }
  } 
  </code></pre>
  
  <p>Even with col returning the right sort of data, the above example isn't acceptable and I can't see why.</p>