-
Book Overview & Buying
-
Table Of Contents
.NET 4.0 Generics Beginner's Guide
By :
As you might have noticed, we haven't covered all the algorithms that Power Collections has to offer. The reason is that the skipped set of algorithms can be easily constructed using several LSQOs.
For example, let's consider the following line of code:
public static ICollection<T> RemoveWhere<T> (ICollection<T> collection, Predicate<T> predicate);
First, we can use the Where() operator to filter the values and then call the Remove() method to delete them.
Algorithms in Power Collections use Predicate<T> and BinaryPredicate<T>. This is because Power Collections was written before Func came into existence. You can replace Predicate<T> with Func<T, bool> and BinaryPredicate<T> with Func<T, T, bool>.
In order to convert the input to these algorithms to be compatible with LSQOs, use the following projection operators ToArray(), ToList(), and AsEnumerable().
Change the font size
Change margin width
Change background colour