NiceExtensions.Enumerable 1.1.6

There is a newer version of this package available.
See the version list below for details.
dotnet add package NiceExtensions.Enumerable --version 1.1.6
                    
NuGet\Install-Package NiceExtensions.Enumerable -Version 1.1.6
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NiceExtensions.Enumerable" Version="1.1.6" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NiceExtensions.Enumerable" Version="1.1.6" />
                    
Directory.Packages.props
<PackageReference Include="NiceExtensions.Enumerable" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NiceExtensions.Enumerable --version 1.1.6
                    
#r "nuget: NiceExtensions.Enumerable, 1.1.6"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NiceExtensions.Enumerable@1.1.6
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NiceExtensions.Enumerable&version=1.1.6
                    
Install as a Cake Addin
#tool nuget:?package=NiceExtensions.Enumerable&version=1.1.6
                    
Install as a Cake Tool

NiceExtensions.Enumerable

About

This contains helpful extensions for IEnumerable and IAsyncEnumerable as well as IEnumerable<Task> extensions for easy parallelization

NiceExtensions.Enumerable

ForEach() and ForEachAsync()

Self explanatory. ForEach does not need a list any more.

Reverse()

Reverses order of an Enumerable.

IEnumerable<KeyValuePair<T1,T2>>.ToDictionary()

Ever been annoyed that you have to write a proper expression for that? Yeah me too.

ByMin() ByMax()

You've wanted an item by max or min value but hate iterating twice over a list and needing two lines for var max = l.Max(i => i.value) and l.First(i ⇒ i.value == max) not anymore

ToCachedEnumerable()

Needing to iterate multiple times over an Enumerable but a .ToList() sucks D this is for you. Caches values you've already Enumerated.

ToCachedEagerLoadingEnumerable()

You're happily enumerating over an Enumerable but after the foreach has done its work the next value isnt ready and takes as long as the work you did already? Time is money! Enumerates in the background while doing work so values are always ready.

NiceExtensions.Enumerable.Tasks

CreateTasks

An easy way to generate Tasks or Func<Task>s out of an Enumerable.

Example

<code>await Directory.EnumerateFiles(@"C:\Windows\System32")<br> .CreateTasks(f ⇒ File.Delete(f))<br> .RunAndWhenAll()</code>

RunAndWhenAll

One of the most powerful extensions. Easy configurable parallel execution, with parameters like maxActionsToRunInParallel, timeoutInMilliseconds (allows you to start tasks beyond the threshhold if no task is completed in an amount of time)

Example

Delete All files in System32 10 at a time and after 1 second block start a new delete regardless.

<code>await Directory.EnumerateFiles(@"C:\Windows\System32")<br> .CreateTasks(f ⇒ File.Delete(f))<br> .RunAndWhenAll(10, 1000, ct)</code>

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.3.0 1,716 1/10/2025
1.2.0 592 12/6/2024
1.1.11 324 8/19/2024
1.1.7 152 8/7/2024
1.1.6 130 8/6/2024
1.1.4 152 8/6/2024
1.1.3 113 8/5/2024
1.1.2 109 7/31/2024
1.1.1 341 7/19/2024
1.1.0-beta4 115 6/25/2024
1.0.1 219 8/29/2023
1.0.0 232 8/5/2023