jjzjj

historyElement

全部标签

c# - 如何使用 LINQ 将 xml 解析为带有 XDocument 的对象

我有一个xml文件如下:..........1..2..我想创建并以此为对象作为历史对象。publicclassHistory{publicstringName{get;set;}publicstringNumber{get;set;}publicListItems{get;set;}}varxElement=XDocument.Parse(xmlString);XElementbody=(XElement)xElement.Root.LastNode;XElementhistoryElement=(XElement)body.LastNode;varhistory=newHistor