So I have this huge XML file that I am converting to an object by using LINQ. And currently I am doing:
var resultStories = from story in resultXML.Descendants("story")
select new NewsStory
{
ArticleFrequency = from tag in story.Descendants("tag")
select new KeyValuePair<string,int>((string)tag.Element("name"),(int)tag.Element("count"))
};
Now this gives creates a IEnumerable<KeyValuePair<String,int>>
for me. But I am wondering if it is possible to get another collection such as a Dictionary<String,int>
or List<new MyItem(string key, int value)
?
I have this huge LINQ book and it only contains information about Objects to XML.
This question pertains XML to Objects.
Thank you :)