ErikForwerk.MissingLinq
0.1.1
dotnet add package ErikForwerk.MissingLinq --version 0.1.1
NuGet\Install-Package ErikForwerk.MissingLinq -Version 0.1.1
<PackageReference Include="ErikForwerk.MissingLinq" Version="0.1.1" />
<PackageVersion Include="ErikForwerk.MissingLinq" Version="0.1.1" />
<PackageReference Include="ErikForwerk.MissingLinq" />
paket add ErikForwerk.MissingLinq --version 0.1.1
#r "nuget: ErikForwerk.MissingLinq, 0.1.1"
#:package ErikForwerk.MissingLinq@0.1.1
#addin nuget:?package=ErikForwerk.MissingLinq&version=0.1.1
#tool nuget:?package=ErikForwerk.MissingLinq&version=0.1.1
ErikForwerk.MissingLinq
What is MissingLinq?
MissingLinq is a lightweight .NET library that fills the gaps in LINQ by providing commonly needed extension methods that are not part of the standard System.Linq namespace.
The standard LINQ API covers a broad set of sequence operations, but experienced developers frequently find themselves writing the same small utility methods over and over again across projects. MissingLinq collects these recurring patterns into a single, well-tested, and NuGet-distributed library so you never have to reinvent them again.
Goals
- Complement LINQ — not replace it. Every method in this library feels like a natural addition to what
System.Linqalready offers. - Zero friction — drop the NuGet package in and the extension methods are immediately available on
IEnumerable<T>, arrays, and other collection types. - Correctness first — every method ships with a full suite of unit tests and benchmarks to ensure both behaviour and performance are well understood.
- Modern .NET — the library targets .NET 10 and embraces current language features such as nullable reference types, collection expressions, and tuple return types.
Installation
dotnet add package ErikForwerk.MissingLinq
Available Extensions
Split
Splits a sequence into two groups in a single pass, based on a predicate — something LINQ's Where cannot do without enumerating the source twice.
| Overload | Description |
|---|---|
TItem[].Split(predicate, sortInPlace) |
Partitions an array into (TrueItems, FalseItems). Supports an in-place mode to avoid an extra allocation. |
IEnumerable<TItem>.Split(predicate) |
Returns two lazily-evaluated sequences from any enumerable source. |
int[] numbers = [1, 2, 3, 4, 5];
var (evens, odds) = numbers.Split(n => n % 2 == 0);
// evens → [2, 4]
// odds → [1, 3, 5]
IsNullOrEmpty
A null-safe emptiness check that mirrors the familiar string.IsNullOrEmpty pattern for collections.
| Overload | Description |
|---|---|
T[]?.IsNullOrEmpty() |
Returns true if the array is null or has a Length of 0. |
IList<T>?.IsNullOrEmpty() |
Returns true if the list is null or has a Count of 0. |
IEnumerable<T>?.IsNullOrEmpty() |
Returns true if the enumerable is null or contains no elements. |
int[]? empty = null;
empty.IsNullOrEmpty(); // true
List<string> names = [];
names.IsNullOrEmpty(); // true
Join
Concatenates the elements of a string sequence into a single string — a direct counterpart to string.Join, but as a LINQ-style extension method available directly on IEnumerable<string>.
| Overload | Description |
|---|---|
IEnumerable<string>.Join(string separator) |
Concatenates all elements using the specified string separator. |
IEnumerable<string>.Join(char separator) |
Concatenates all elements using the specified character separator. |
string[] words = ["Hello", "World", "foo"];
string result = words.Join(", ");
// result → "Hello, World, foo"
string csv = words.Join(',');
// csv → "Hello,World,foo"
Both overloads throw an
ArgumentNullExceptionifsource(or the stringseparator) isnull.
Project Structure
ErikForwerk.MissingLinq/
├── Source/
│ └── ErikForwerk.MissingLinq/ # Library source
├── UnitTests/
│ └── ErikForwerk.MissingLinq.Tests/ # xUnit test suite
└── Benchmarks/
└── ErikForwerk.MissingLinq.Benchmark/ # BenchmarkDotNet benchmarks
Contributing
Contributions are welcome! If you regularly find yourself writing a LINQ-like helper that is absent from the standard library, feel free to open an issue or submit a pull request.
Please ensure all new methods are accompanied by:
- XML documentation comments
- Unit tests (using xUnit)
- A benchmark (using BenchmarkDotNet)
License
This project is licensed under the MIT License.
| 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. |
-
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.