0
選擇的XElement元素及其子我需要在一個單一的步驟,選擇父母和孩子,這樣我可以讓他們爲IEnumerable和遍歷他們如何在一個單一的LINQ查詢
我試過parent.descendantsandself但不工作根據您所提供的,我認爲應該DescendantsAndSelf
工作信息的任何想法
<MenuItem id="MyAccount" rmId="MyAccount" loc-attr="MyAccount,text" text="My Account" target="" display="true">
<MenuItem id="MyProducts" rmId="MyProducts" loc-attr="MyProducts,text" text="My McAfee Products" target="" display="true" href="http://home.mcafee.com/root/myAccount.aspx" />
<MenuItem id="MyProfile" rmId="MyProfile" loc-attr="MyProfile,text" text="Update McAfee Account Info" target="" display="true" href="https://home.mcafee.com/Secure/Protected/MyAccountInfo.aspx" />
<MenuItem id="MyArSettings" rmId="MyArSettings" loc-attr="MyArSettings,text" text="My Auto-Renewal Settings" href="https://home.mcafee.com/Secure/Protected/AutoRenew.aspx" target="" display="true" />
</MenuItem>