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

Remove

The Remove operator can be called on a sequence of nodes or attributes to remove them. This method will cache a copy of the nodes or attributes in a List to eliminate the Halloween problem discussed in the previous chapter.

Prototypes

The Remove operator has two prototypes.

Example. The First Remove Prototype
public static void Remove (
  this IEnumerable<XAttribute> source
)

This version is called on a sequence of attributes and removes all attributes in the source sequence.

Example. The Second Remove Prototype
public static void Remove<T> (
  this IEnumerable<T> source
) where T : XNode

This version is called on a sequence of a specified type, which must be nodes or some type derived from nodes, and removes all nodes in the source sequence. ...

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