aalmuqahwi.BuildingBlocks.Domain 0.1.0

dotnet add package aalmuqahwi.BuildingBlocks.Domain --version 0.1.0
                    
NuGet\Install-Package aalmuqahwi.BuildingBlocks.Domain -Version 0.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="aalmuqahwi.BuildingBlocks.Domain" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="aalmuqahwi.BuildingBlocks.Domain" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="aalmuqahwi.BuildingBlocks.Domain" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add aalmuqahwi.BuildingBlocks.Domain --version 0.1.0
                    
#r "nuget: aalmuqahwi.BuildingBlocks.Domain, 0.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package aalmuqahwi.BuildingBlocks.Domain@0.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=aalmuqahwi.BuildingBlocks.Domain&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=aalmuqahwi.BuildingBlocks.Domain&version=0.1.0
                    
Install as a Cake Tool

BuildingBlocks

Reusable Domain/Application/Infrastructure building blocks — DDD, Clean Architecture, CQRS, and Modular Monolith patterns — for .NET.

Status

🚧 Actively developed — built to learn NuGet packaging and reduce copy-paste across my own projects. APIs may still change.

Packages

BuildingBlocks.Domain

Core DDD primitives, no external dependencies.

  • Result / Error — success/failure without exceptions
  • Entity<TId> / AggregateRoot<TId> — equality by ID, domain event tracking
  • DomainEvent / IDomainEvent — immutable facts raised by aggregates
  • ValueObject — base for immutable, structurally-equal types

BuildingBlocks.Application

CQRS and cross-cutting contracts, depends only on BuildingBlocks.Domain.

  • ICommand / IQuery<TResult> — request markers
  • ICommandHandler<,> / IQueryHandler<,> — handler contracts
  • IDispatcher — routes commands/queries to their handlers
  • IPipelineBehavior<,> — cross-cutting middleware around handler execution (logging, validation, etc.)
  • IUnitOfWork — persistence flush abstraction, technology-agnostic
  • IDomainEventHandler<> / IDomainEventDispatcher — domain event handling contracts

BuildingBlocks.Infrastructure

Concrete DI-based implementations, depends on BuildingBlocks.Application.

  • Dispatcher — resolves and invokes command/query handlers via keyed DI, runs pipeline behaviors
  • DomainEventDispatcher — resolves and invokes all registered handlers for a given domain event
  • AddBuildingBlocksInfrastructure(...) — one-line registration for everything above (or call AddDispatcher(...) / AddDomainEventDispatcher(...) individually)

Usage

// Program.cs
builder.Services.AddBuildingBlocksInfrastructure(typeof(Program).Assembly);

// Somewhere in your app
public record CreateOrderCommand(string ProductId) : ICommand<Result<Guid>>;

public class CreateOrderHandler : ICommandHandler<CreateOrderCommand, Result<Guid>>
{
    public Task<Result<Guid>> Handle(CreateOrderCommand command, CancellationToken ct)
        => Task.FromResult(Result.Success(Guid.NewGuid()));
}

// Dispatching
var result = await dispatcher.SendAsync(new CreateOrderCommand("prod-123"));

Design notes

  • Domain has zero dependencies by design — it's safe to reference from anywhere
  • IUnitOfWork and persistence are intentionally technology-agnostic — bring your own EF Core/Dapper/etc. implementation
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on aalmuqahwi.BuildingBlocks.Domain:

Package Downloads
aalmuqahwi.BuildingBlocks.Application

CQRS and cross-cutting contracts — ICommand, IQuery, IDispatcher, IPipelineBehavior, IUnitOfWork, IIntegrationEvent, IOutboxWriter, IOutboxMessageStore, IOutboxProcessor. Depends on BuildingBlocks.Domain.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 163 7/24/2026