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
Next Post
New Release of StyleCop Cmd  19 Sep 2010
Prior Post
Avoiding Null Checks  13 Sep 2010
Related Posts
Browsers and WSL  31 Mar 2024
Factory methods and functions  05 Mar 2023
Using Constructors  27 Feb 2023
An Inconvenient API  18 Feb 2023
Method Archetypes  11 Sep 2022
A bash puzzle, solved  02 Jul 2022
A bash puzzle  25 Jun 2022
Improve your troubleshooting by aggregating errors  11 Jun 2022
Improve your troubleshooting by wrapping errors  28 May 2022
Keep your promises  14 May 2022
Archives
September 2010
2010