XDocument.Descendants method could returns a collection of the descendant elements for this document or element, in document order. It has two overloads
Descendants() and
Descendants(XName). For more information, please refer to this link.
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Contributor
2231 Points
3706 Posts
what does Descendants keyword does in LINQ ?
Jul 19, 2015 08:29 AM|sudip_inn|LINK
what Descendants keyword does ?
can we omit this ? please write in details with example to understand the usage of Descendants keyword. thanks
</div>All-Star
40565 Points
6233 Posts
Microsoft
Re: what does Descendants keyword does in LINQ ?
Jul 20, 2015 04:00 AM|Fei Han - MSFT|LINK
Hi sudip_inn,
XDocument.Descendants method could returns a collection of the descendant elements for this document or element, in document order. It has two overloads Descendants() and Descendants(XName). For more information, please refer to this link.
https://msdn.microsoft.com/en-us/library/system.xml.linq.xdocument.descendants(v=vs.110).aspx
Besides, this sample is for your reference.
EmployeesInfo.XML
Web page
Best Regards,
Fei Han