如果我有喜欢的xml:的LINQ to XML组查询
<List>
<Item>
<Type>Type1</Type>
</Item>
<Item>
<Type>Type1</Type>
</Item>
<Item>
<Type>Type2</Type>
</Item>
</List>
我基本上要以某种方式创建一个字典或列表参阅下文此。这是我到目前为止有:
var grouped = (from p in _xmlDoc.Descendants("Item")
group p by p.Element("Blah").Value into Items
select Items);
我怎么会选择它,使我创造一个Dictionary<string, List<Item>>
,其中关键是分组和(“类型1”或“2型”)的名称。