Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
谁能给我一个将 xmlNodelists 组合到一个列表的解决方案。
我会使用LINQ的.Concat方法。问题XmlNodeList是IEnumerable与IEnumerable< XmlNode >. 因此,您必须调用.Cast< XmlNode >您的XmlNodeLists.
.Concat
XmlNodeList
IEnumerable
IEnumerable< XmlNode >
.Cast< XmlNode >
XmlNodeLists
例如:
var List = nodesoriginal.Cast<XmlNode>().Concat<XmlNode>(nodesupdate.Cast<XmlNode>());