Menu

1 / 2

Why I Stopped Using MediatR and Built CQRS From Scratch in .NET 10

DEV Community·Pedro Ferreira·6 months ago
#Az1yYeMq
#why#dotnet#cqrs#tresponse#result
Reading 0:00
15s threshold

Why I Stopped Using MediatR and Built CQRS From Scratch in .NET 10

MediatR is a great library. I'm not here to trash it.

But when it moved to a paid model for commercial use, a lot of teams — including mine — had to make a decision. And the more I looked at what MediatR actually does under the hood, the more I realised: this is not complicated enough to justify an external dependency.

So I built it myself. Here's what that looks like, why I made each decision, and whether it was worth it.

What MediatR actually does

Strip away the marketing and MediatR does two things:

Takes a request object and routes it to the right handler

Runs a configurable pipeline of behaviors before and after the handler

That's it. The "mediator pattern" is mostly a fancy name for a dispatcher with middleware.…

Continue reading — create a free account

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