Koto.Application 0.3.0-preview.3

This is a prerelease version of Koto.Application.
There is a newer prerelease version of this package available.
See the version list below for details.
dotnet add package Koto.Application --version 0.3.0-preview.3
                    
NuGet\Install-Package Koto.Application -Version 0.3.0-preview.3
                    
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="Koto.Application" Version="0.3.0-preview.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Koto.Application" Version="0.3.0-preview.3" />
                    
Directory.Packages.props
<PackageReference Include="Koto.Application" />
                    
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 Koto.Application --version 0.3.0-preview.3
                    
#r "nuget: Koto.Application, 0.3.0-preview.3"
                    
#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 Koto.Application@0.3.0-preview.3
                    
#: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=Koto.Application&version=0.3.0-preview.3&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Koto.Application&version=0.3.0-preview.3&prerelease
                    
Install as a Cake Tool

Koto.Application

CQRS dispatcher, pipeline behaviors, and cross-service integration abstractions for .NET microservices. Part of the Koto suite.

Install

dotnet add package Koto.Application

What's included

Type Purpose
ICommand / ICommand<TResult> Marker interfaces for write operations (ICommandBase)
IQuery<TResult> Marker interface for read operations (IQueryBase)
ICommandHandler<T> / ICommandHandler<T, TResult> Command handler contracts
IQueryHandler<TQuery, TResult> Query handler contract
ICqrsDispatcher Dispatches commands and queries to registered handlers
IPipelineBehavior<TRequest, TResponse> Middleware for the CQRS pipeline
KotoApplicationOptions Opt-in behavior registration (AddLoggingBehavior(), AddTransactionBehavior(), AddBehavior(type))
LoggingBehavior<,> Logs every command/query with timing
TransactionBehavior<,> Wraps each command in a IUnitOfWork transaction
IUnitOfWork Abstraction for committing a database transaction
IRepository<TAgg, TId> Persistence contract for aggregates (pairs with IUnitOfWork)
IIntegrationEvent / IntegrationEvent External event contract
IIntegrationCommand / IIntegrationCommand<TResult> Cross-service command contract
IIntegrationEventPublisher Publishes integration events (implemented in infra)
IIntegrationCommandDispatcher Dispatches integration commands (implemented in infra)
AssemblyScanning GetLoadableTypes — scan guard against ReflectionTypeLoadException

Usage

Register

// Handlers only — no pipeline behaviors:
builder.Services.AddKotoApplication(typeof(Program).Assembly);

// With behaviors (opt-in; registration order = execution order, first is outermost):
builder.Services.AddKotoApplication(
    o => o.AddLoggingBehavior().AddTransactionBehavior(),
    typeof(Program).Assembly);
builder.Services.AddKotoValidation(typeof(Program).Assembly); // ValidationBehavior from Koto.Validation
// Recommended order: Logging → Validation → Transaction.

Implement a command

public sealed record PlaceOrderCommand(Guid CustomerId, List<OrderItem> Items)
    : ICommand<OrderId>;

public sealed class PlaceOrderHandler : ICommandHandler<PlaceOrderCommand, OrderId>
{
    public async Task<Result<OrderId>> HandleAsync(PlaceOrderCommand cmd, CancellationToken ct)
    {
        // business logic
    }
}

Dispatch

var result = await _dispatcher.SendAsync(new PlaceOrderCommand(customerId, items), ct);

Pipeline behaviors

Behaviors are resolved against the concrete command/query type: an open-generic registration like ValidationBehavior<,> closes over PlaceOrderCommand at dispatch time, so IValidator<PlaceOrderCommand> is discovered. A behavior can also target a single request by implementing IPipelineBehavior<PlaceOrderCommand, Result<OrderId>>.

// Custom open-generic behavior:
builder.Services.AddKotoApplication(
    o => o.AddLoggingBehavior().AddBehavior(typeof(MyMetricsBehavior<,>)),
    typeof(Program).Assembly);

Design notes

  • IDomainEvent — internal; free to change; never crosses service boundaries.
  • IIntegrationEvent — external contract; versioned; published to Kafka via Wolverine.
  • IIntegrationCommand — fire-and-forget command to another service; IIntegrationCommand<TResult> expects a reply.
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 (5)

Showing the top 5 NuGet packages that depend on Koto.Application:

Package Downloads
Koto.Validation

FluentValidation extensions for Koto: MustBeValueObject, MustBeEntity, ListMustContainNumberOfItems, and ValidationBehavior pipeline integration.

Koto.Messaging.Wolverine

Wolverine-based implementation of Koto messaging abstractions: integration event publishing, command dispatching, Kafka consumers with idempotency, correlation propagation, and DLQ routing.

Koto.Infrastructure.EFCore

EF Core 10 integration for Koto DDD: generic repository, strongly-typed ID converters, specification pattern, and Wolverine outbox wiring.

Koto.Testing

DDD-specific test helpers for Koto: fluent aggregate assertions, in-memory fake repositories, fake integration event publisher, and Result<T> AwesomeAssertions extensions.

Koto.Api.FastEndpoints

FastEndpoints integration for Koto: CQRS base endpoints, RFC 7807 Problem Details from Error, correlation ID middleware, and global exception handler.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.0-preview.6 33 7/20/2026
0.3.0-preview.5 34 7/19/2026
0.3.0-preview.4 40 7/19/2026
0.3.0-preview.3 81 7/11/2026
0.3.0-preview.2 68 7/11/2026
0.3.0-preview.1 73 7/3/2026
0.2.0-preview.1 83 6/28/2026
0.1.0-preview.5 84 5/13/2026
0.1.0-preview.4 78 5/13/2026
0.1.0-preview.3 69 5/13/2026
0.1.0-preview.2 67 5/11/2026