Menu

Post image 1
Post image 2
Post image 3
1 / 3
0

CQRS Without MediatR: Hand-Rolled Command and Query Handlers in .NET

DEV Community·Adrián Bailador·29 days ago
#2SuqFSdl
Reading 0:00
15s threshold

For years, opening a new .NET project meant the same opening ritual: dotnet add package MediatR . The library became so synonymous with CQRS in the .NET community that many developers couldn't tell where the pattern ended and the package began. Then MediatR moved to a commercial license. Suddenly, every team that had built their architecture around it was asking the same question: do we actually need this? This isn't a criticism of MediatR or of Jimmy Bogard — the library shaped how a generation of .NET developers think about handlers, pipelines, and clean separation of concerns, and the community owes him a real debt. The licensing change is just an opportunity to look at what's underneath, and to notice how little of it actually needs to be a library at all. Most teams don't need MediatR. CQRS is a pattern, not a library — and the .NET DI container has everything you need to implement it cleanly. This article shows how.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More