Select Xml Node using Linq to XML

前端 未结 4 1492
遥遥无期
遥遥无期 2020-12-19 07:40

my Xml file :




        
4条回答
  •  遥遥无期
    2020-12-19 08:20

    You are not casting x you are casting x.Descendants(). x.Descendants() returns a collection, hence the plural method semantic. Off the top of my head you should be able to do x.Descendants("CustomerId").FirstOrDefault() as XElement

提交回复
热议问题