NiceExtensions.Enumerable
1.1.6
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
<PackageReference Include="NiceExtensions.Enumerable" Version="1.1.6" />
<PackageVersion Include="NiceExtensions.Enumerable" Version="1.1.6" />
<PackageReference Include="NiceExtensions.Enumerable" />
paket add NiceExtensions.Enumerable --version 1.1.6
#r "nuget: NiceExtensions.Enumerable, 1.1.6"
#:package NiceExtensions.Enumerable@1.1.6
#addin nuget:?package=NiceExtensions.Enumerable&version=1.1.6
#tool nuget:?package=NiceExtensions.Enumerable&version=1.1.6
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 | Versions 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. |
-
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.