O'Reilly logo

Pro LINQ: Language Integrated Query in C# 2008 by Joseph C. Rattz Jr.

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required