Skip to content
Pawel Gerr edited this page Mar 1, 2026 · 64 revisions

Build TestResults NuGet Downloads

Thinktecture.Runtime.Extensions
Thinktecture.Runtime.Extensions.EntityFrameworkCore8
Thinktecture.Runtime.Extensions.EntityFrameworkCore9
Thinktecture.Runtime.Extensions.EntityFrameworkCore10
Thinktecture.Runtime.Extensions.Json
Thinktecture.Runtime.Extensions.Newtonsoft.Json
Thinktecture.Runtime.Extensions.MessagePack
Thinktecture.Runtime.Extensions.AspNetCore
Thinktecture.Runtime.Extensions.Swashbuckle

This library uses Roslyn Source Generators, Analyzers, CodeFixes, and Refactorings to provide Smart Enums (type-safe alternatives to enum), Value Objects (immutable domain primitives with built-in validation), and Discriminated Unions (type-safe "one of" types).

Core Concepts

  • Smart Enums -- Type-safe enumerations with behavior, supporting keyed (with an underlying value) and keyless variants.

    • Customization -- Attribute settings, equality, comparison, parsable interfaces, and more
    • Framework Integration -- System.Text.Json, EF Core, ASP.NET Core, MessagePack, Newtonsoft.Json
    • Performance -- Span-based JSON, zero-allocation parsing, benchmarks
  • Value Objects -- Immutable domain primitives (simple single-value or complex multi-property) with built-in validation and factory methods.

    • Customization -- Attribute settings, equality comparers, factory methods, operators
    • Framework Integration -- System.Text.Json, EF Core, ASP.NET Core, MessagePack, Newtonsoft.Json
  • Discriminated Unions -- Type-safe unions including ad-hoc unions (Union<T1, T2, ...>) and regular inheritance-based unions, with Switch/Map pattern matching.

Supporting Topics

Convenience Methods and Classes

Requirements

  • C# 11 (or higher) for generated code
  • SDK 8.0.416 (or higher) for building projects

Migrations

Clone this wiki locally