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

DescendantsAndSelf

The DescendantsAndSelf operator can be called on a sequence of elements and returns a sequence containing each source element and its descendant elements.

Prototypes

The DescendantsAndSelf operator has two prototypes.

Example. The First DescendantsAndSelf Prototype
public static IEnumerable<XElement> DescendantsAndSelf (
  this IEnumerable<XElement> source
)

This version is called on a sequence of elements and returns a sequence of elements containing each source element and its descendant elements.

Example. The Second DescendantsAndSelf Prototype
public static IEnumerable<XElement> DescendantsAndSelf (
  this IEnumerable<XElement> source,
  XName name
)

This version is like the first, except only those elements matching the ...

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