C# in Depth

Cover of C# in Depth
Order now (3rd edition)

Predicate<T> in LINQ? Not so much...

Chapter 5: Fast-tracked delegates: 5.4.2

Created: 3/15/2008
Last updated: 3/15/2008

In section 5.4.2, I wrote:

The Predicate<T> delegate type we've used so far isn't used very widely in .NET 2.0, but it becomes very important in .NET 3.5 where it's a key part of LINQ.

It's possible that this was true at the time I originally wrote chapter 5 (significantly before .NET 3.5 was released) but it certainly isn't true now. LINQ tends to use Func<TSource,bool> for its predicates (where TSource is the type of the sequence involved). The two delegates are equivalent, of course - they have the same signature - but it's still not strictly speaking a use of Predicate<T>. Ah well.