DescendantNodesAndSelf

The DescendantNodesAndSelf operator can be called on a sequence of elements and returns a sequence containing each source element itself and each source element's descendant nodes.

Prototypes

The DescendantNodesAndSelf operator has one prototype.

Example. The Only DescendantNodesAndSelf Prototype
public static IEnumerable<XNode> DescendantNodesAndSelf (
  this IEnumerable<XElement> source
)

This version is called on a sequence of elements and returns a sequence of nodes containing each source element itself and each source element's descendant nodes.

Examples

For this example, I will use the same example used for the DescendantNodes operator, except I will call the DescendantNodesAndSelf operator, as shown in Listing ...

Get Pro LINQ: Language Integrated Query in C# 2008 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.