Post #2870567
2025-04-03 15:25 UTC
@maxitb@mastodon.social that only works if you can manage access to your resources, MedtiatR doesn't have any ability to do that, it just resolves handlers (often, very slowly) and uses dependency injection to inject any resources, no different from injecting them straight into your controllers but with the added delay of MediatR resolving the correct handler
And moving away from MediatR specifically, most resources dotnet devs will ever interact with will already be controlled by a query/command handler, like in the case of databases, that's what the database engine/server is doing, and it's going to be better suited, optimised and battle hardened to handle and schedule queries than anything that could be slopped out in dotnet
Replies (1)
-
@mbrdev@mastodon.social 2025-04-03 20:26
@crashtestdev@woof.tech @maxitb@mastodon.social CQRS is extremely useful in some cases, especially when backed by a clustered DB with read only connections to backups. It’s just another tool on the tool belt to use in high performance systems, MediatR doesn’t really have anything to do with CQRS and so not sure why all the hate. I like MediatR for its behaviours, though often I don’t need it.