Populating a ProviderCollection from custom config in beta 2
For example, in web.config, I have something like this:
<mySection defaultProvider="PopForums">
<providers>
<add name="MyProvider" type="MyProvider, MyAssy" connectionStringName="Whatever" />
</providers>
</mySection>
Then my custom config section looks something like:
public class MySection : ConfigurationSection
{
[ConfigurationProperty("defaultProvider", DefaultValue = "Whatevah")]
public string DefaultProvider
{
get { return (string)base["defaultProvider"]; }
set { base["defaultProvider"] = value; }
}
[ConfigurationProperty("providers", RequiredValue = false)]
public ProviderCollection Providers
{
get { return (ProviderCollection)base["providers"]; }
}
}
Now how do I get this stuff initialized? The code I'm revisiting from a year ago doesn't even compile because the classes I used, some of them anyway, are gone. I can't find any newer examples.