ErikForwerk.MissingLinq 0.1.1

dotnet add package ErikForwerk.MissingLinq --version 0.1.1
                    
NuGet\Install-Package ErikForwerk.MissingLinq -Version 0.1.1
                    
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="ErikForwerk.MissingLinq" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ErikForwerk.MissingLinq" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="ErikForwerk.MissingLinq" />
                    
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 ErikForwerk.MissingLinq --version 0.1.1
                    
#r "nuget: ErikForwerk.MissingLinq, 0.1.1"
                    
#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 ErikForwerk.MissingLinq@0.1.1
                    
#: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=ErikForwerk.MissingLinq&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=ErikForwerk.MissingLinq&version=0.1.1
                    
Install as a Cake Tool

ErikForwerk.MissingLinq

Current Repository Status Codecov Test Coverage NuGet wakatime


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.Linq already 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 ArgumentNullException if source (or the string separator) is null.


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 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
0.1.1 148 7/16/2026
0.1.0 130 5/23/2026
0.0.5 115 4/5/2026