Skip to content

Introduction

Pragmatic Design is a .NET meta-framework powered by Source Generators. It turns your architecture declarations into fully wired, production-ready code — all at compile time, with zero reflection and zero runtime overhead.

Building .NET applications today means writing the same boilerplate over and over: repository implementations, endpoint registrations, validation wiring, DI setup, entity configurations. This repetitive code is error-prone, hard to maintain, and slows you down.

With Pragmatic Design, you declare your intent using attributes and base classes. A unified Source Generator detects your architecture and forges the rest:

[DomainAction]
public partial class PlaceOrder : IDomainAction<OrderResult>
{
public required string CustomerId { get; init; }
public required List<OrderItem> Items { get; init; }
}
// The Source Generator produces:
// ✓ Invoker with full DI pipeline
// ✓ Validation, authorization, logging
// ✓ HTTP endpoint registration
// ✓ Zero reflection — all compile-time
  • Zero Reflection — Everything is resolved at compile time. No typeof(T).GetProperties(), no hidden allocations.
  • Modular by Design — 20+ composable modules. Add a NuGet, the generator sees it, code is forged. Remove it, code disappears.
  • Pragmatic, Not Dogmatic — Sensible defaults that work. Override anything. It’s your code, forged your way.
  • AOT Ready — Zero reflection means native AOT compilation works out of the box.

Pragmatic Design is organized in three layers:

LayerModulesPurpose
FoundationResult, Ensure, DI, AbstractionsCore building blocks
CapabilitiesValidation, Mapping, Caching, Specification, i18nFeature modules
IntegrationActions, Endpoints, Persistence, CompositionFull-stack wiring

Each module is independently useful — but they compose beautifully together.