I have a configuration file, for example:
<ConfigurationFile> <Config name="some.configuration.setting" value="some.configuration.value"/> <Config name="some.configuration.setting2" value="some.configuration.value2"/> ... </ConfigurationFile>
I am trying to read this in XML and convert it to a dictionary. I tried to code something this, but this is clearly wrong, as it does not compile.
Dictionary<string, string> configDictionary = (from configDatum in xmlDocument.Descendants("Config") select new { Name = configDatum.Attribute("name").Value, Value = configDatum.Attribute("value").Value, }).ToDictionary<string, string>(Something shoudl go here...?);
If someone can tell me how to do this, it will be very helpful. I could always, of course, read it
source share