In-memory range and multirange types for .NET 10, mirroring PostgreSQL's six built-in range domains (int4range, int8range, numrange, daterange, tsrange, tstzrange). Each type is a discriminated union of five sealed variants with exhaustive pattern matching.
.NET 10 · C# 14 (extension methods) · MSTest 4.x · EF Core + Npgsql (PostgreSQL bridge)
CodoMetis.ValueRanges/— Core library: range types, interfaces, set opsCodoMetis.ValueRanges.EFCore.PostgreSQL/— EF Core provider for LINQ-to-SQL translationCodoMetis.ValueRanges.Tests/— Unit tests (one file per operation)CodoMetis.ValueRanges.EFCore.PostgreSQL.Tests/— EF Core integration testsdocs/— Agent docs (read relevant doc before starting work)
dotnet build # Build everything
dotnet test # Run all tests
dotnet test --filter "ClassName=RangeContainsTests" # Single test class
dotnet test --filter "FullyQualifiedName~Contains_FiniteRange" # Single method
dotnet pack # Pack NuGet packages- Read
docs/architecture.mdbefore modifying range types or interfaces - Explore the codebase — range operations are per-shape (Finite, UnboundedStart, etc.)
- Run
dotnet testafter each change; tests are method-level parallel - Commit with conventional format:
feat:,fix:,refactor:,docs:
docs/architecture.md— Discriminated union pattern, interface hierarchy, RangeSet internalsdocs/testing.md— Test organization, patterns, shape-combination matrix
- NEVER create external subtypes of range base records — the private constructor enforces exhaustive pattern matching; breaking this removes compiler guarantees
- ALWAYS preserve RangeSet's invariant (sorted, disjoint, non-adjacent, no empties) on every code path that constructs or mutates a set
- Do NOT add new range types without adding corresponding
IntersectEngine/MergeEngineper-shape implementations inInternals/