Skip to content

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.

A modular framework needs shared contracts. Without a central home for them:

  • Circular dependencies emerge — Persistence needs ICurrentUser for auditing; Identity needs IRepository for 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, or DbContext, 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.

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.

Terminal window
dotnet add package Pragmatic.Abstractions

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 |

  • .NET 10.0+

Part of the Pragmatic.Design ecosystem — see Licensing. Pragmatic.Abstractions is MIT-licensed.