How can I create a Dictionary
(or even better, a ConcurrentDictionary
) using Linq?
For example, if I have the following XML
<students>
<student name="fred" address="home" avg="70" />
<student name="wilma" address="home, HM" avg="88" />
.
. (more <student> blocks)
.
</students>
loaded into XDocument doc;
and wanted to populate a ConcurrentDictionary<string, Info>
(where the key is the name and Info
is some class holding address and average. Populating Info
is not my concern now), how would I do this?