Menu

Post image 1
Post image 2
1 / 2
0

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

DEV Community·Pedro Ferreira·about 1 month ago
#MybKfztw
#why#dotnet#cqrs#tresponse#result#fullscreen
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. Understanding this is the unlock — once you see it that way, building it yourself feels obvious.…

Continue reading — create a free account

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

Read More