C# in Depth

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

Incorrect signature of "Join" method

Chapter 11: Query expressions and LINQ to Objects: P300, centre of page

Created: 6/25/2008
Last updated: 6/26/2008
Severity: Technical error

The signature of the Join method in the middle of page 300 is incorrect - the innerKeySelector parameter should be of type Func<TInner,TKey>. In addition, it would be clearer to use TOuter instead of T. This affects the previous paragraph as well, giving this as the replacement:

Inner joins are translated by the compiler into calls to the Join method. The signature of the overload used for LINQ to Objects is as follows (when imagining it to be an instance method of IEnumerable<TOuter>):
IEnumerable<TResult> Join<TInner,TKey,TResult> (
   IEnumerable<TInner> inner,
   Func<TOuter,TKey> outerKeySelector,
   Func<TInner,TKey> innerKeySelector,
   Func<TOuter,TInner,TResult> resultSelector

This should be corrected for the second edition.