Custom app.config section with a simple list of "add" elements
- by Joe
How do I create a custom app.config section that is just a simple list of add elements?
I have found a few examples (e.g. http://stackoverflow.com/questions/1316058) for custom sections that look like this:
<RegisterCompanies>
<Companies>
<Company name="Tata Motors" code="Tata"/>
<Company name="Honda Motors" code="Honda"/>
</Companies>
</RegisterCompanies>
But how do I avoid the extra collection element ("Companies") so that it looks the same as the appSettings and connectionStrings sections? In other words, I'd like:
<registerCompanies>
<add name="Tata Motors" code="Tata"/>
<add name="Honda Motors" code="Honda"/>
</registerCompanies>