Combine XmlNodelist

前端 未结 1 1246
旧巷少年郎
旧巷少年郎 2021-01-18 00:59

Can any one please give me a solution to combine xmlNodelists to a single list .

1条回答
  •  一向
    一向 (楼主)
    2021-01-18 01:05

    I would use LINQ's .Concat method. The problem is that XmlNodeList is IEnumerable as opposed to IEnumerable< XmlNode >. Thus you have to call .Cast< XmlNode > on your XmlNodeLists.

    For example:

       var List = nodesoriginal.Cast().Concat(nodesupdate.Cast());
    

    0 讨论(0)
提交回复
热议问题