Pragmatic.Abstractions
Cross-cutting contracts for the Pragmatic.Design ecosystem — pure interfaces, attributes, and records shared by all modules, with zero dependency on ASP.NET Core or EF Core. This is Layer 0.
The Problem
Section titled “The Problem”A modular framework needs shared contracts. Without a central home for them:
- Circular dependencies emerge — Persistence needs
ICurrentUserfor auditing; Identity needsIRepositoryfor user storage. If each module owns its interfaces, they depend on each other and the build fails. - Framework coupling spreads — if domain modules depend on
ClaimsPrincipal,HttpContext, orDbContext, they can’t run in console apps, workers, tests, or non-HTTP hosts. - Interface duplication fragments the ecosystem — without one shared
ICurrentUser, every module defines its own, and a single DI registration can’t satisfy all consumers.
The Solution
Section titled “The Solution”One lightweight package that every module references and that depends on (almost) nothing — only the contracts crossing module boundaries: interfaces, attributes, records, enums, null-object singletons.
Pragmatic.Abstractions (Layer 0) ▲ ┌─────────────────┼──────────────────┐ Pragmatic.Actions Pragmatic.Events Pragmatic.Persistence Pragmatic.Identity Pragmatic.Authorization …No circular dependencies, no framework coupling, one interface per concept. You rarely reference it directly — it arrives transitively through the modules you use; reference it explicitly when you author a module that must expose or consume a cross-cutting contract.
Installation
Section titled “Installation”dotnet add package Pragmatic.AbstractionsStatus
Section titled “Status”Stable within the 0.8 preview — the contract surface is the ecosystem’s foundation. See the roadmap.
| Concepts | Why Layer 0 exists, what belongs here, what doesn’t | | Getting Started | Referencing the contracts from a module | | Interfaces | The full interface/attribute catalog + which module implements each | | Design Principles | Layer dependency rules, framework-neutrality | | Common Mistakes | The most frequent pitfalls | | Troubleshooting | Problem/solution guide |
Requirements
Section titled “Requirements”- .NET 10.0+
License
Section titled “License”Part of the Pragmatic.Design ecosystem — see Licensing. Pragmatic.Abstractions is MIT-licensed.