Skip to content

OnixLabs.Core.Collections

matthew edited this page May 27, 2026 · 4 revisions

OnixLabs.Core.Collections Namespace

The OnixLabs.Core.Collections namespace provides factory helpers for constructing mutable and immutable collections through a single, uniform naming convention, together with a comparer-normalising extension. The IEqualityComparerExtensions class resides in the nested OnixLabs.Core.Collections.Generic namespace.

Namespace OnixLabs.Core.Collections, OnixLabs.Core.Collections.Generic
Assembly OnixLabs.Core.dll (NuGet)

Remarks

The Collection class makes collection construction read consistently regardless of the target type: each factory comes in an Empty… flavour (an empty collection of the named type) and an …Of flavour (a collection populated with the supplied items). IEqualityComparerExtensions resolves an optional, possibly-null IEqualityComparer<T> to a concrete comparer, and is used throughout the LINQ extensions to normalise comparer arguments.

Bring the namespace into scope with using OnixLabs.Core.Collections; (and using OnixLabs.Core.Collections.Generic; for the comparer extension).

Types in this namespace

Type Description
Collection A static factory class that creates empty or pre-populated instances of the standard mutable and immutable collection types.
IEqualityComparerExtensions A static class (in OnixLabs.Core.Collections.Generic) that resolves an optional IEqualityComparer<T> to a concrete comparer.

See Also

ONIXLabs .NET Library


Clone this wiki locally