This project has moved and is read-only. For the latest updates, please go here.

Generate ElementColleciton as List<T>

Feb 23, 2008 at 4:09 AM
for a complicated config, there will be too many collection types

so, just generate as List<T> is a good option.
Feb 24, 2008 at 11:15 AM
There are a number of reasons that I generate these collection classes:
  • You have to provide some metadata that allows the configuration system to know how collections are configured (element names, collection type, ...). This is part of the generated collection classes.
  • Using List<T> would introduce a dependency on .NET 2.0 and at this point the generated configuration classes can even be used in .NET 1.x.
  • And finally, I don't think it's even possible to use List<T> as a configuration collection class :-) I've briefly tried it but didn't get it to work because it lacks the necessary metadata as described above.