LiteBus.Commands 6.0.1

dotnet add package LiteBus.Commands --version 6.0.1
                    
NuGet\Install-Package LiteBus.Commands -Version 6.0.1
                    
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="LiteBus.Commands" Version="6.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="LiteBus.Commands" Version="6.0.1" />
                    
Directory.Packages.props
<PackageReference Include="LiteBus.Commands" />
                    
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 LiteBus.Commands --version 6.0.1
                    
#r "nuget: LiteBus.Commands, 6.0.1"
                    
#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 LiteBus.Commands@6.0.1
                    
#: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=LiteBus.Commands&version=6.0.1
                    
Install as a Cake Addin
#tool nuget:?package=LiteBus.Commands&version=6.0.1
                    
Install as a Cake Tool

LiteBus

<p align="center"> <img src="assets/logo/litebus-logo.svg" alt="LiteBus logo" width="300"> </p>

<p align="center"> <a href="https://github.com/litenova/LiteBus/actions/workflows/build-and-test.yml"><img src="https://github.com/litenova/LiteBus/actions/workflows/build-and-test.yml/badge.svg" alt="Build and test status"></a> <a href="https://www.nuget.org/packages/LiteBus"><img src="https://img.shields.io/nuget/v/LiteBus.svg" alt="NuGet version"></a> <a href="https://dotnet.microsoft.com/download/dotnet/10.0"><img src="https://img.shields.io/badge/.NET-10.0-512BD4" alt=".NET 10"></a> <a href="LICENSE"><img src="https://img.shields.io/github/license/litenova/LiteBus" alt="MIT license"></a> </p>

LiteBus provides command, query, and event mediation for .NET 10 applications using CQS and DDD. Durable modules add inbox, outbox, saga, storage, dispatch, ingress, hosting, and operational APIs without requiring unrelated broker or database SDKs.

LiteBus is open source under the MIT license, free for commercial use, and will remain free.

What LiteBus Includes

  • Separate command, query, and event contracts, mediators, handlers, and pipelines.
  • Handler priorities, filters, pre-handlers, post-handlers, and error handlers.
  • Durable inbox processing for commands and transactional outbox processing for events.
  • Saga state with correlation, tenancy, optimistic concurrency, and duplicate dispatch suppression.
  • Opt-in PostgreSQL, Entity Framework Core, in-memory, AMQP, Kafka, AWS SQS, and Azure Service Bus adapters.
  • Generic Host integration, health checks, diagnostics, management endpoints, and OpenTelemetry registration.

Quick Start

Install the command module for Microsoft dependency injection:

dotnet add package LiteBus.Commands.Extensions.Microsoft.DependencyInjection

Define a command and handler:

public sealed record CreateProductCommand(string Name, decimal Price) : ICommand<Guid>;

public sealed class CreateProductCommandHandler : ICommandHandler<CreateProductCommand, Guid>
{
    public Task<Guid> HandleAsync(
        CreateProductCommand command,
        CancellationToken cancellationToken)
    {
        return Task.FromResult(Guid.NewGuid());
    }
}

Register messaging and command handlers:

builder.Services.AddLiteBus(liteBus =>
{
    liteBus.AddMessaging(_ => { });
    liteBus.AddCommands(commands =>
        commands.RegisterFromAssembly(typeof(Program).Assembly));
});

Inject ICommandMediator and send the command:

var productId = await commandMediator.SendAsync(
    new CreateProductCommand("Widget", 9.99m),
    cancellationToken);

The Getting Started guide covers commands, queries, events, module registration, and handler discovery.

Durable Messaging

The inbox persists commands before execution. The outbox persists events before publication. Saga storage tracks correlated workflow state. Each axis selects its storage, dispatch, ingress, and processor modules explicitly.

Use in-memory adapters for tests. Use PostgreSQL or Entity Framework Core when message writes must participate in an application transaction. Broker integrations remain separate packages so applications install only the SDKs they use.

See Reliable Messaging, Transactional Messaging Writes, and Package Selection.

Documentation

Build and Test

dotnet restore LiteBus.slnx
dotnet build LiteBus.slnx --configuration Release --no-restore
dotnet test LiteBus.slnx --configuration Release --no-build
pwsh ./scripts/Test-Documentation.ps1

Docker is required for integration suites that exercise PostgreSQL, AMQP, Kafka, AWS SQS, and Azure Service Bus emulators.

Project Policy

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.

NuGet packages (6)

Showing the top 5 NuGet packages that depend on LiteBus.Commands:

Package Downloads
LiteBus.Commands.Extensions.Microsoft.DependencyInjection

Host-framework composition APIs for the LiteBus.Commands.Extensions.Microsoft.DependencyInjection package.

LiteBus

Mediator and durable messaging contracts for explicit command, query, event, inbox, and outbox composition in .NET applications.

LiteBus.Commands.Extensions.MicrosoftDependencyInjection

LiteBus is a lightweight, flexible in-process mediator for implementing Command Query Separation (CQS) patterns in .NET applications.

Ramsha.LocalMessaging

Modular extensible framework built on top of ASP.NET Core.

LiteBus.Commands.Extensions.Autofac

Host-framework composition APIs for the LiteBus.Commands.Extensions.Autofac package.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
6.0.1 0 7/20/2026
6.0.0 112 7/18/2026
5.0.0 13,060 5/29/2026
4.4.0 10,934 5/19/2026
4.3.0 70,058 2/17/2026
4.2.0 72,769 11/11/2025
4.1.0 2,285 10/30/2025
4.0.0 7,745 9/18/2025
3.1.0 34,796 8/5/2025
3.0.0 9,988 7/21/2025
2.2.3 3,177 7/18/2025
2.2.2 256 7/18/2025
2.2.1 14,774 7/8/2025
2.2.0 314 7/8/2025
2.1.0 383 7/1/2025
2.0.0 4,166 4/29/2025
1.1.0 344 4/24/2025
1.0.0 258 4/19/2025
0.25.1 332 4/17/2025
Loading failed