如果我有喜歡的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型」)的名稱。