<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/cqrs-kommand-in-asp-net-core-vn32ucljr" -->

---
title: CQRS Kommand in ASP.NET Core | daily.dev
description: Kommand is a free, open-source, lightweight .NET library for implementing CQRS with a mediator pattern, positioned as an alternative now that MediatR is no...
canonical: https://daily.dev/posts/cqrs-kommand-in-asp-net-core-vn32ucljr
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: CQRS Kommand in ASP.NET Core | daily.dev
og:description: Kommand is a free, open-source, lightweight .NET library for implementing CQRS with a mediator pattern, positioned as an alternative now that MediatR is no...
og:url: https://daily.dev/posts/cqrs-kommand-in-asp-net-core-vn32ucljr
og:image: https://api.daily.dev/og/posts/vN32uClJR.png
og:image:alt: CQRS Kommand in ASP.NET Core
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# CQRS Kommand in ASP.NET Core

**[NikolaTech](https://daily.dev/sources/nikolatech)** · 4 min read · 0 upvotes · 0 comments

## Summary

Kommand is a free, open-source, lightweight .NET library for implementing CQRS with a mediator pattern, positioned as an alternative now that MediatR is no longer free. It explains CQRS basics (separating commands and queries), then walks through installing the pre-release NuGet package, defining commands/queries and their handlers, registering Kommand, wiring up minimal API endpoints, adding built-in validation with dependency injection support, and using type-specific interceptors (global, command, and query) for cross-cutting concerns like logging. The library also supports pub/sub and built-in observability, originally built internally at Atherio before being open-sourced.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://nikolatech.net/blogs/cqrs-kommand-aspnet-core>

## Questions this post answers

### What is the Kommand library for CQRS in .NET and how is it different from MediatR?

Kommand is a free, open-source, lightweight .NET library for implementing CQRS and the mediator pattern, built by Atherio for internal production use before being open-sourced. Unlike MediatR, which is no longer free, Kommand provides commands and queries with separate handler interfaces, built-in validation with dependency injection support, and type-specific interceptors for cross-cutting concerns like logging, plus pub/sub and observability features.

_Developers evaluating MediatR alternatives can track new CQRS tooling like Kommand on daily.dev._

### How do you dispatch commands and queries separately using IMediator in a .NET minimal API?

Use IMediator's SendAsync method for commands and QueryAsync for queries, which makes the read/write intent explicit in minimal API endpoints. A command is mapped with app.MapPost calling mediator.SendAsync(command, cancellationToken), while a query is mapped with app.MapGet calling mediator.QueryAsync(request, cancellationToken), each returning Results.Ok with the response.

_Developers structuring CQRS endpoints in ASP.NET Core can find implementation patterns like this on daily.dev._

### How do you add validation that depends on a database or external service in a CQRS command handler?

Kommand supports validators implementing IValidator that run before the command handler and support dependency injection, so validation logic can query a database or call external services rather than just checking request properties. Validators return a ValidationResult built from a list of ValidationError objects, and validation is enabled by calling config.WithValidation() during service registration.

_Developers building validation pipelines for commands can explore patterns like this on daily.dev._

## Similar posts on daily.dev

- [CQRS Without the Astronaut Architecture](https://daily.dev/posts/cqrs-without-the-astronaut-architecture-pu7zqnvab) · The T-Shaped Dev · 84 upvotes · 1 comments
- [Building NestJS Applications Following the CQRS Model](https://daily.dev/posts/building-nestjs-applications-following-the-cqrs-model-p9b9rfml2) · Telerik · 22 upvotes · 0 comments
- [Introduction to CQRS using MongoDB](https://daily.dev/posts/introduction-to-cqrs-using-mongodb-qdpqeqjeh) · Foojay.io · 1 upvotes · 0 comments
- [CQRS Design Pattern](https://daily.dev/posts/cqrs-design-pattern-qyxe3wyb7) · Debezium · 118 upvotes · 1 comments
- [Optimizing Search Performance with CQRS: Relational Writes and NoSQL Reads](https://daily.dev/posts/optimizing-search-performance-with-cqrs-relational-writes-and-nosql-reads-3zldezxon) · Sergio Lema · 9 upvotes · 0 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#), [#aspnet](https://daily.dev/tags/aspnet)

[View this post on daily.dev](https://daily.dev/posts/cqrs-kommand-in-asp-net-core-vn32ucljr)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"CQRS Kommand in ASP.NET Core","url":"https://daily.dev/posts/cqrs-kommand-in-asp-net-core-vn32ucljr","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/cqrs-kommand-in-asp-net-core-vn32ucljr"},"datePublished":"2026-10-04T13:05:51.879Z","dateModified":"2026-10-04T13:12:27.320Z","description":"Kommand is a free, open-source, lightweight .NET library for implementing CQRS with a mediator pattern, positioned as an alternative now that MediatR is no...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9c3d98d3b67210c02cccebc7aeb58c8e?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/9c3d98d3b67210c02cccebc7aeb58c8e?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"NikolaTech","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"NikolaTech","logo":"https://media.daily.dev/image/upload/s--1h2fO6FL--/f_auto,q_auto/v1791119050/logos/nikolatech?_a=BAMAMicg0","url":"https://daily.dev/sources/nikolatech"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/cqrs-kommand-in-asp-net-core-vn32ucljr","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":".net,c#,aspnet","timeRequired":"PT4M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"NikolaTech","item":"https://daily.dev/sources/nikolatech"},{"@type":"ListItem","position":3,"name":"CQRS Kommand in ASP.NET Core"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/cqrs-kommand-in-asp-net-core-vn32ucljr#faq","mainEntity":[{"@type":"Question","name":"What is the Kommand library for CQRS in .NET and how is it different from MediatR?","acceptedAnswer":{"@type":"Answer","text":"Kommand is a free, open-source, lightweight .NET library for implementing CQRS and the mediator pattern, built by Atherio for internal production use before being open-sourced. Unlike MediatR, which is no longer free, Kommand provides commands and queries with separate handler interfaces, built-in validation with dependency injection support, and type-specific interceptors for cross-cutting concerns like logging, plus pub/sub and observability features. Developers evaluating MediatR alternatives can track new CQRS tooling like Kommand on daily.dev."}},{"@type":"Question","name":"How do you dispatch commands and queries separately using IMediator in a .NET minimal API?","acceptedAnswer":{"@type":"Answer","text":"Use IMediator's SendAsync method for commands and QueryAsync for queries, which makes the read/write intent explicit in minimal API endpoints. A command is mapped with app.MapPost calling mediator.SendAsync(command, cancellationToken), while a query is mapped with app.MapGet calling mediator.QueryAsync(request, cancellationToken), each returning Results.Ok with the response. Developers structuring CQRS endpoints in ASP.NET Core can find implementation patterns like this on daily.dev."}},{"@type":"Question","name":"How do you add validation that depends on a database or external service in a CQRS command handler?","acceptedAnswer":{"@type":"Answer","text":"Kommand supports validators implementing IValidator that run before the command handler and support dependency injection, so validation logic can query a database or call external services rather than just checking request properties. Validators return a ValidationResult built from a list of ValidationError objects, and validation is enabled by calling config.WithValidation() during service registration. Developers building validation pipelines for commands can explore patterns like this on daily.dev."}}]}
```

