开发者

why doesn't XElement have a ToDictionary linq expression?

开发者 https://www.devze.com 2023-01-02 01:47 出处:网络
For some reason ToDictionary isn\'t working. 开发者_如何学运维I am using vs.net 2010 and 4.0 XElement root = XElement.Load(fullPathToXml);

For some reason ToDictionary isn't working.

开发者_如何学运维I am using vs.net 2010 and 4.0

XElement root = XElement.Load(fullPathToXml);            
IEnumerable<XElement> nodes = root.Elements("root");

var dic = nodes.ToDictionary(...)

I want to convert it to a dictionary<string,string>

it says there is no defintion for 'ToDictionary'...?


Add

using System.Linq;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号