EnumerationQuest 1.1.0
dotnet add package EnumerationQuest --version 1.1.0
NuGet\Install-Package EnumerationQuest -Version 1.1.0
<PackageReference Include="EnumerationQuest" Version="1.1.0" />
paket add EnumerationQuest --version 1.1.0
#r "nuget: EnumerationQuest, 1.1.0"
// Install EnumerationQuest as a Cake Addin
#addin nuget:?package=EnumerationQuest&version=1.1.0
// Install EnumerationQuest as a Cake Tool
#tool nuget:?package=EnumerationQuest&version=1.1.0
EnumerationQuest
Avoids multiple enumeration.
Introduction
EnumerationQuest library allows the evaluation of multiple properties of an IEnumerable
in a single enumeration.
It's as simple as that:
var (min, max) = enumerable.GetMin().AndMax();
Tell me more
EnumerationQuest provides the same methods as LINQ to Objects
to evaluate properties of IEnumerable
.<br>
But unlike LINQ, EnumerationQuest allows the evaluation of several properties at once; that's it, in a single enumeration.
To achieve this, EnumerationQuest uses fluent pattern to construct an EnumerationRequests
object.
- The first method is called on the
IEnumerable
source object with theGet
prefix. - The following ones are called on
EnumerationRequests
object with theAnd
prefix. - The enumeration and the evaluations are performed at the deconstruction of the
EnumerationRequests
object.
Et voilà:
var (min, avg, max, count, evenValues) = e.GetMin()
.AndAverage()
.AndMax()
.AndCount()
.And(o => o.Select(i => i % 2 == 0).ToList());
Available methods
- Aggregate: applies an accumulator function over a sequence.
- All: determines whether all elements of a sequence satisfy a condition.
- Any: determines whether any element of a sequence exists or satisfies a condition.
- Average: computes the average of a sequence of numeric values.
- Contains: determines whether a sequence contains a specified element.
- Count: returns the number of elements in a sequence; or the number of elements that satisfy a condition.
- DelimitedString (aka
String.Join
): concatenates the elements of a sequence, inserting the specified separator between each element. - ElementAt: returns the element at a specified index in a sequence.
- ElementsAt: returns the elements at the specified indices in a sequence.
- ElementAtOrDefault: returns the element at a specified index in a sequence or a default value if the index is out of range.
- First: returns the first element of a sequence; or the first element that satisfies a condition.
- FirstOrDefault: returns the first element of a sequence; or the first element that satisfies a condition; or a default value if such an element does not exist .
- Get/And: transform the sequence into an
IObservable
and allow to use react extensions methods. - HasDuplicates: determines whether a sequence contains a duplicate element.
- IndexOf (from
List<T>
andArray
): returns the zero-based index of the first occurrence of a value in a sequence. - IndicesOf: returns the zero-based indices of all occurrences of a value in a sequence.
- Last: returns the last element of a sequence; or the last element that satisfies a condition.
- LastOrDefault: returns the last element of a sequence; or the last element that satisfies a condition; or a default value if such an element does not exist .
- LongCount: returns a long that represent the number of elements in a sequence; or the number of elements that satisfy a condition.
- Max: returns the maximum value in a sequence of value; or a sequence of transformed values.
- MaxBy: returns the maximum value in a sequence according to a specified key.
- MaximumsBy: returns the maximums values in a sequence according to a specified key.
- Min: returns the minimum value in a sequence of value; or a sequence of transformed values.
- MinBy: returns the minimum value in a sequence according to a specified key.
- MinimumsBy: returns the minimums value in a sequence according to a specified key.
- SequenceEqual: determines whether two sequences are equal according to an equality comparer.
- Single: returns the single element of a sequence; or the single element that satisfies a condition.
- SingleOrDefault: returns the single element of a sequence; or the single element that satisfies a condition; or a default value if such an element does not exist .
- Slice (replace
Skip
,SkipLast
,Take
andTakeLast
): takes a specified range of contiguous elements from a sequence. - Sum: computes the sum of a sequence of numeric values.
- ToDictionary:
creates a
Dictionary<TKey,TValue>
from a sequence. - ToHashSet:
creates a
HashSet<TValue>
from a sequence. - ToLookup:
creates a
ILookup<TKey,TValue>
from a sequence.
Status
See the todo.md file to see the current status of the library.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 is compatible. net5.0-windows was computed. net6.0 was computed. 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 was computed. 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. |
-
net5.0
- System.Reactive (>= 5.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.