I just stumbled across this - a very useful extension LINQ library called MoreLinq.

The list of extensions that it provides includes some real gems:

  • MaxBy (or MinBy) - scan a sequence and return the item with the highest (or lowest) value as identified by a delegate.

This differs from Max (or Min) by returning the item from the sequence, not the value itself.

  • ForEach - this exists on List<T> but isn’t supplied by default.

  • Pipe - applies a delegate to each item of the sequence, without modifying the sequence

The project includes lots more - check out the MoreLinq project home page, the list of operators, or go straight to the download page.

Comments

blog comments powered by Disqus