Repository navigation
Home
Pawel Gerr edited this page Dec 1, 2026
·
71 revisions
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).
-
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 (
AdHocUnion<T1, T2, ...>) and regular inheritance-based unions, withSwitch/Mappattern matching.- Customization -- Attribute settings, backing fields, stateless types, constructors
- Framework Integration -- System.Text.Json, EF Core, MessagePack, Newtonsoft.Json
-
Object Factories -- Custom creation logic via
[ObjectFactory<T>]for advanced parsing and deserialization scenarios - Serilog Integration -- Serilog destructuring for Smart Enums, Value Objects, and ad-hoc unions
-
Analyzer Diagnostics -- Reference for all
TTRESGdiagnostic rules - Source Generator Configuration -- MSBuild properties for controlling generator behavior, and what other source generators in the same project see
-
AI Coding Assistants -- the agent skill (
npx skillsor Claude Code plugin) and Context7 (MCP) support for Claude Code, Cursor, and other AI coding agents
- Empty (collections/actions/disposables)
- ToReadOnlyCollection
- TrimOrNullify (strings)
- SingleItem (collections)
- C# 13 (or higher) for generated code
- .NET 10 SDK (or higher) for building projects
- Target framework net9.0 (or higher)