I have implemented custom config section like this
<directorySettings>
<domainConfigurationList>
<domainConfiguration id="1" name="name1" url="http://www.google.com"/>
<domainConfiguration id="2" name="name2" url="http://www.bing.com"/>
</domainConfigurationList>
</directorySettings>
I can set only one field as key:
protected override object GetElementKey(ConfigurationElement element)
{
return ((DirectorySettingsConfigurationElement)element).Name;
}
but I also need to have possibility to search using not only by key 'name' but also by field 'id'. Here is part of my DirectorySettingsConfigurationElementCollection
:
public DirectorySettingsConfigurationElement Get(string name)
{
return (DirectorySettingsConfigurationElement)BaseGet(name);
}
public DirectorySettingsConfigurationElement GetById(int id)
{
// ???
return null;
}
What is the best way to get my DirectorySettingsConfigurationElement
by custom field (not by key)