DKNet.SlimBus.Extensions
13.3.1
dotnet add package DKNet.SlimBus.Extensions --version 13.3.1
NuGet\Install-Package DKNet.SlimBus.Extensions -Version 13.3.1
<PackageReference Include="DKNet.SlimBus.Extensions" Version="13.3.1" />
<PackageVersion Include="DKNet.SlimBus.Extensions" Version="13.3.1" />
<PackageReference Include="DKNet.SlimBus.Extensions" />
paket add DKNet.SlimBus.Extensions --version 13.3.1
#r "nuget: DKNet.SlimBus.Extensions, 13.3.1"
#:package DKNet.SlimBus.Extensions@13.3.1
#addin nuget:?package=DKNet.SlimBus.Extensions&version=13.3.1
#tool nuget:?package=DKNet.SlimBus.Extensions&version=13.3.1
DKNet.SlimBus.Extensions
CQRS and messaging glue on top of SlimMessageBus — fluent command, query
and event-consumer contracts, FluentResults-based handlers, lazy Mapster mapping, and an opt-in EF Core auto-save
and domain-event publisher.
✨ Why use it?
- Request shape says what a message is. Implementing
Fluents.Requests.*marks a write,Fluents.Queries.*marks a read — no attributes, no naming conventions to remember. - Expected business failures are results, not exceptions. Commands return
FluentResultstypes, so "product not found" is a value the caller inspects rather than a thrown exception to catch. - EF Core writes without a
SaveChangesAsynccall.AddSlimBusEfCoreInterceptor<TDbContext>()saves theDbContextfor you after a successful write, andAddSlimBusEventPublisher<TDbContext>()forwards the domain events that save raised onto the bus. - No bundled transport. You call SlimMessageBus's own
AddSlimMessageBus(...)and pick the provider (memory, Azure Service Bus, Kafka) yourself; theFluentscontracts and your handlers stay the same either way.
🚀 Quick Start
Use a .NET 10 console project. Install the packages, then replace Program.cs with the example.
dotnet new console -f net10.0 -n SlimBusDemo
cd SlimBusDemo
dotnet add package DKNet.SlimBus.Extensions
dotnet add package SlimMessageBus.Host.Memory --version 3.5.0
using DKNet.SlimBus.Extensions;
using FluentResults;
using Microsoft.Extensions.DependencyInjection;
using SlimMessageBus;
using SlimMessageBus.Host;
using SlimMessageBus.Host.Memory;
var services = new ServiceCollection();
services.AddLogging();
services.AddSlimMessageBus(mbb => mbb
.AddServicesFromAssembly(typeof(Program).Assembly)
.AddChildBus("Memory", m => m
.WithProviderMemory()
.AutoDeclareFrom(typeof(Program).Assembly)));
await using var provider = services.BuildServiceProvider();
var bus = provider.GetRequiredService<IMessageBus>();
var result = await bus.Send(new Ping("hello"));
Console.WriteLine(result.IsSuccess ? result.Value : "failed");
public record Ping(string Text) : Fluents.Requests.IWitResponse<string>;
internal sealed class PingHandler : Fluents.Requests.IHandler<Ping, string>
{
public Task<IResult<string>> OnHandle(Ping request, CancellationToken cancellationToken) =>
Task.FromResult<IResult<string>>(Result.Ok($"pong: {request.Text}"));
}
Run with dotnet run. Prints pong: hello.
This package already depends on EF Core — it references X.PagedList.EF and DKNet.EfCore.Events — but nothing
needs an actual database unless you call the two EF Core registration methods
(AddSlimBusEfCoreInterceptor<TDbContext>(), AddSlimBusEventPublisher<TDbContext>()), which are opt-in on top of
the contracts shown above.
Documentation
| Guide | Read when |
|---|---|
| Package overview | Start with architecture and the end-to-end flow. |
| Send write commands | Declare requests with Fluents.Requests.INoResponse / IWitResponse<T> and implement their handlers. |
| Run read queries | Declare queries with Fluents.Queries.IWitResponse<T> / IWitPageResponse<T> and implement their handlers. |
| Consume published events | Implement Fluents.EventsConsumers.IHandler<TEvent> to react to a message on the bus. |
| Auto-save after a successful write | Register AddSlimBusEfCoreInterceptor<TDbContext>() so a successful write saves the DbContext for you. |
| Publish domain events onto the bus | Register AddSlimBusEventPublisher<TDbContext>() so events raised by DKNet.EfCore.Events reach IMessageBus. |
| Map results lazily | Defer a Mapster mapping until a handler's result value is actually read. |
| Product | Versions 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. |
-
net10.0
- DKNet.EfCore.Events (>= 13.3.1)
- FluentResults (>= 4.0.0)
- Mapster (>= 10.0.13)
- Microsoft.Extensions.Hosting.Abstractions (>= 10.0.12)
- SlimMessageBus (>= 3.0.0)
- SlimMessageBus.Host (>= 3.5.0)
- SlimMessageBus.Host.Interceptor (>= 3.0.0)
- X.PagedList.EF (>= 10.6.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on DKNet.SlimBus.Extensions:
| Package | Downloads |
|---|---|
|
DKNet.AspCore.SlimBus
Package Description |
|
|
DKNet.AspCore.Extensions
DKNet is an enterprise-grade .NET library collection focused on advanced EF Core extensions, dynamic predicate building, and the Specification pattern. It provides production-ready tools for building robust, type-safe, and testable data access layers, including dynamic LINQ support, LinqKit integration. Designed for modern cloud-native applications, DKNet enforces strict code quality, async best practices, and full documentation for all public APIs. Enterprise-grade .NET library suite for modern application development, featuring advanced EF Core extensions (dynamic predicates, specifications, LinqKit), robust Domain-Driven Design (DDD) patterns, and domain event support. DKNet empowers scalable, maintainable, and testable solutions with type-safe validation, async/await, XML documentation, and high code quality standards. Ideal for cloud-native, microservices, and enterprise architectures. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 13.3.1 | 0 | 10/26/2026 |
| 13.3.0 | 103 | 10/22/2026 |
| 13.2.8 | 70 | 10/22/2026 |
| 13.2.7 | 147 | 10/11/2026 |
| 13.2.6 | 97 | 10/10/2026 |
| 13.2.5 | 352 | 10/2/2026 |
| 13.2.4 | 92 | 10/1/2026 |
| 13.2.3 | 106 | 10/1/2026 |
| 13.2.2 | 99 | 10/1/2026 |
| 13.2.1 | 103 | 10/1/2026 |
| 13.2.0 | 98 | 10/1/2026 |
| 13.1.3 | 180 | 9/21/2026 |
| 13.1.2 | 372 | 9/18/2026 |
| 13.1.1 | 108 | 9/18/2026 |
| 13.1.0 | 101 | 9/18/2026 |
| 13.0.2 | 114 | 9/18/2026 |
| 13.0.1 | 116 | 9/18/2026 |
| 13.0.0 | 124 | 9/18/2026 |
| 12.0.0 | 130 | 9/17/2026 |
| 11.0.0 | 186 | 9/17/2026 |