budul.EnumerableExtensions
2.0.0
dotnet add package budul.EnumerableExtensions --version 2.0.0
NuGet\Install-Package budul.EnumerableExtensions -Version 2.0.0
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="budul.EnumerableExtensions" Version="2.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="budul.EnumerableExtensions" Version="2.0.0" />
<PackageReference Include="budul.EnumerableExtensions" />
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 budul.EnumerableExtensions --version 2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: budul.EnumerableExtensions, 2.0.0"
#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 budul.EnumerableExtensions@2.0.0
#: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=budul.EnumerableExtensions&version=2.0.0
#tool nuget:?package=budul.EnumerableExtensions&version=2.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
EnumerableExtensions
A collection of extension methods for working with enumerable data in .NET, providing utilities for counting, merging, converting, grouping and manipulating collections.
Installation
Install via NuGet:
dotnet add package budul.EnumerableExtensions
Or visit: https://www.nuget.org/packages/budul.EnumerableExtensions
Features
Counting & Aggregation
CountOrDefault<T>()- Returns count or 0 if null/emptyMaxOrDefault<T>()/MaxOrNull<T>()- Safe max operationsMinOrDefault<T>()/MinOrNull<T>()- Safe min operations
Merging
Merge()- Combines non-null items into a delimited string with optional sorting and distinct filteringMerge<T, TProp>()- Merges items by selecting a specific property
Conversion
ToArrayOrDefault()- Converts to array or returns null if emptyToListOrDefault()- Converts to list or returns null if emptyAsSingleEnumerable()/AsArray()/AsList()- Wraps a single value
Grouping & Chaining
ChunkAfter(),ChunkBefore(),SplitAt(),SplitAtChange(),Framed()GroupByHash()- Groups by the values of several propertiesToPairs(),ToTriples(),ToConsecutivePairs(),ToConsecutiveTriples(),DistinctSuccessive()
Sequences
MapSequence()- Finds a sequence inside a master track (KMP) and maps the master indexes to the input items
Usage Example
using EnumerableExtensions;
var items = new[] { "c", "b", "a", "c" };
// Merge with sorting and distinct
string result = items.Merge(); // "a,b,c"
// Merge without sorting (still distinct)
string unsorted = items.Merge(preventSort: true); // "c,b,a"
// Merge without sorting and without distinct
string raw = items.Merge(preventSort: true, preventDistinct: true); // "c,b,a,c"
// Safe counting
int count = items.CountOrDefault(); // 4
Target Frameworks
- .NET 10
Breaking changes in 2.0
- Target framework is .NET 10 only (previously .NET Standard 2.0 / 2.1, .NET 7 / 8).
AsEnumerable<T>(this T)is nowAsSingleEnumerable<T>(this T), the old name hijackedSystem.Linq.Enumerable.AsEnumerablefor arrays and lists.ToConsecutivePairsandToConsecutiveTriplesreturn nothing for an empty sequence.Mergekeeps default values of value types (e.g.0), sorts numbers numerically and strings ordinally.GroupByHashcompares the property values themselves instead of a hash, the dependency onbudul.HashExtensionsis gone.- Argument validation of iterator based methods now happens at the call, not at the first enumeration.
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. 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.
-
net10.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 |
|---|---|---|
| 2.0.0 | 109 | 11/26/2026 |
| 1.34.1 | 415 | 12/25/2025 |
| 1.34.0 | 293 | 12/24/2025 |
| 1.33.0 | 476 | 7/11/2023 |
| 1.32.0 | 342 | 5/10/2023 |
| 1.31.0 | 457 | 2/28/2023 |
| 1.30.0 | 610 | 8/24/2022 |
| 1.29.0 | 657 | 7/29/2022 |
| 1.28.0 | 611 | 7/28/2022 |
| 1.27.0 | 612 | 7/28/2022 |
| 1.26.0 | 618 | 7/27/2022 |
| 1.25.0 | 691 | 2/9/2022 |
| 1.24.1 | 675 | 2/3/2022 |
| 1.24.0 | 636 | 2/1/2022 |
| 1.23.0 | 539 | 10/26/2021 |
| 1.22.0 | 560 | 10/8/2021 |
| 1.21.2 | 548 | 9/28/2021 |
| 1.21.1 | 535 | 8/25/2021 |
| 1.21.0 | 529 | 8/17/2021 |
| 1.20.0 | 567 | 5/20/2021 |
Loading failed