SharedKernel is a suite of .NET NuGet packages that give you the domain-driven design and Clean Architecture building blocks you need without writing them from scratch. FromDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/jordiaragonzaragoza/JordiAragonZaragoza.SharedKernel/llms.txt
Use this file to discover all available pages before exploring further.
BaseAggregateRoot and BaseValueObject to MediatR pipeline behaviors and MassTransit integration buses, every layer of your architecture is covered.
Introduction
Learn what SharedKernel is, how it’s structured, and which packages to add to your project.
Quickstart
Install the packages and wire up a working aggregate with CQRS in under five minutes.
NuGet Packages
Browse all published packages, their responsibilities, and the dependency graph.
Domain Layer
Entities, aggregate roots, value objects, domain events, business rules, and smart enums.
What’s Included
Domain Primitives
BaseAggregateRoot, BaseEntity, BaseValueObject, BaseEntityId, and event-sourced variants.CQRS & Pipelines
ICommand, IQuery, ICommandBus, IQueryBus with full MediatR pipeline behavior support.EF Core Infrastructure
Base
DbContext classes, repositories, soft-delete interceptor, and projection stores.Event Store
KurrentDB-backed event store with catch-up subscriptions and stream mapping.
Integration Bus
MassTransit + RabbitMQ integration bus for cross-service events and commands.
REST API Helpers
BaseApiCommandController, exception middleware, and ResponseBuilder for Problem Details.Get Started in Three Steps
Install the packages you need
Add the SharedKernel NuGet packages for the layers you’re building. At minimum, install the Domain package for DDD primitives.
Define your aggregate root
Inherit from
BaseAggregateRoot<TId> and implement the required When and EnsureValidState methods.Register services and dispatch commands
Register SharedKernel services in See the Quickstart for the complete working example.
Program.cs, define a command, and dispatch it through the ICommandBus.SharedKernel targets .NET 10 on the
main branch. Previous versions for .NET 7, 8, and 9 are available on dedicated branches.