C# in Depth

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

More signature changes

Chapter 11: Query expressions and LINQ to Objects: P303 and P306

Created: 6/26/2008
Last updated: 6/26/2008
Severity: Language improvement

The signatures of GroupJoin and SelectMany on pages 303 and 306 respectively are currently expressed as if they were methods of IEnumerable<T>. They might be clearer (and match MSDN) if the type parameters were named TOuter and TSource respectively. This would give the following signature on page 303:

IEnumerable<TResult> GroupJoin<TInner,TKey,TResult> (
   IEnumerable<TInner> inner,
   Func<TOuter,TKey> outerKeySelector,
   Func<TInner,TKey> innerKeySelector,
   Func<TOuter,IEnumerable<TInner>,TResult> resultSelector

and this signature on page 306, with a change to the last word of the preceding paragraph as well:

IEnumerable<TResult> SelectMany<TCollection,TResult> (
   Func<TSource,IEnumerable<TCollection>> collectionSelector,
   Func<TSource,TCollection,TResult> resultSelector

These changes are minor enough not to be worth making for simple reprints, but should be rolled into any more widespread reprints.