title: Configuration element containing a collection of child elements
body: <p>I want to have a custom section in my web.config like so:</p>
  
  <pre><code>&lt;MyMainSection attributeForMainSection = "value foo"&gt;
  
      &lt;add name = "foo" 
      type = "The.System.Type.Of.Foo, Assembly, Qualified Name Type Name" /&gt;
  
      &lt;add name = "bar" 
      type = "The.System.Type.Of.Bar, Assembly, Qualified Name Type Name" /&gt;
  
  &lt;/MyMainSection&gt;
  </code></pre>
  
  <p>I have defined the following code:</p>
  
  <pre><code>using System.Configuration;
  
  class MyMainSection : ConfigurationSection
  {
      /*I've provided custom implemenation. 
        Not including it here for the sake of brevity. */ 
      [ConfigurationProperty("attributeForMainSection")]
      public string AttributeForMyMainSection { get; set; }
  
      [ConfigurationProperty("add")]
      public AddElement TheAddElement { get; set; }
  
      private class AddElement: ConfigurationElement
      {
          /* Implementation done */
      }
  
  }
  </code></pre>
  
  <p>Should this property <code>TheAddElement</code> be <code>IEnumerable&lt;AddElement&gt;</code> or just <code>AddElement</code> if I want to allow multiple add elements?</p>