CQRS & MediatR in a .NET 8 Web API 🚀

  Рет қаралды 20,038

Patrick God

Patrick God

Күн бұрын

Пікірлер: 33
@bigg_Mike
@bigg_Mike 13 күн бұрын
short and quality video thanks 😎
@qubitza
@qubitza 7 ай бұрын
Thanks for the Video and the super explanation ❤ It might feel super clean in the first place. However, for me the mediator added another layer of abstraction which made it harder to analyze dependencies. Moreover, I wondered how to execute multiple commands in a transaction.
@Guillen8606
@Guillen8606 25 күн бұрын
Great explanation.Plain and simple. I like the fact the Batman has a higher level than Ironman
@ChathurangaLiyanagenk
@ChathurangaLiyanagenk 2 ай бұрын
Short and sweet. Thanks a lot.❤
@TrinitaRebeccaLasrado
@TrinitaRebeccaLasrado Ай бұрын
You made it so easy to understand, Thank you❤
@-INC0GNIT0-
@-INC0GNIT0- 7 ай бұрын
Great stuff, I always like your channel because you always show stuff we developers really need and the common streamers always seem to ignore to show like: authorization, mailing, refreshing tokens, ... it's always very knowledgeable engineering concepts
@eyoo369
@eyoo369 6 ай бұрын
Everyone saying that Mediatr is useless. For our team the biggest advantage is having controllers with literally 1 line of code and a single dependancy injection which is MediatR itself. Also having your project structured by Features (commands & queries) makes it so much more easy to navigate as opposed to a God-like 1000+ line service class. And the best of all is that testing commands & queries is a lot easier than testing and mocking a service class. Everyone can work on a feature and saves us git merge headaches when 2 or more devs are working in the same Service class.
@shadmansudipto7287
@shadmansudipto7287 2 ай бұрын
You could do the same without mediatr right? although I guess this enforced the pattern so your coworkers don't go back to putting everything in one file.
@eyoo369
@eyoo369 2 ай бұрын
@@shadmansudipto7287 Absolutely, could've been done without MediatR but having mediatr helps by achieving clean pipeline middleware. It works seamlessly together with FluentValidation and other libraries .
@portahack
@portahack 5 ай бұрын
Amazing video, really good example and very well explained
@daWoody01
@daWoody01 7 ай бұрын
Any benefits or issues using MediatR in a Blazor component? I usually inject a service into a Blazor component and use the service to make any queries or commands.
@imadabab
@imadabab 6 ай бұрын
Great video. Thanks a lot. Very clear.
@oseifrimponggg
@oseifrimponggg Ай бұрын
Simple. Thanks!
@codefoxtrot
@codefoxtrot 7 ай бұрын
It was wayyyy simpler before MediatR and CRQS, but thanks for explaining in a quick demo! Though it leaves me wondering what's the benefit of doing this in a larger project? Seems like it just adds another layer of work.
@SireTheKing
@SireTheKing 5 ай бұрын
CQRS is a pattern that allows developers to decouple everything, which makes it easier to update and feature add-ons via interfaces. it also allows for easier testing since you can mock the dependencies. This creates loosely coupled applications, and the trade-off is more complexity.
@dimasvyrydiuk5955
@dimasvyrydiuk5955 5 ай бұрын
Thanks, you taught me how to work with the backend. Best)
@axelbryancasauran5159
@axelbryancasauran5159 3 ай бұрын
Is it possible to create and register a generic mediatr command and handler?
@adam-xt8te
@adam-xt8te 7 ай бұрын
God created The World in 7 days. Patrick explaned CQRS in 22 minutes.
@PatrickGod
@PatrickGod 7 ай бұрын
😂
@harishchaudhari9681
@harishchaudhari9681 5 ай бұрын
True fabulous tutorial on CQRS❤❤❤❤
@dasfahrer8187
@dasfahrer8187 7 ай бұрын
Interesting, but it's just another abstraction layer that doesn't buy you much. If you're managing multiple brownfield projects that already have a standard pattern, introducing this only adds time and confusion to technical debt as you're now having to navigate multiple ways of doing things.
@PatrickGod
@PatrickGod 7 ай бұрын
Thanks for sharing your thoughts! What approach do you prefer for implementing the same feature without adding an extra abstraction layer?
@dasfahrer8187
@dasfahrer8187 7 ай бұрын
@@PatrickGod Well, for some context, we have dozens of projects with API interfaces in them that hit various services across our own internal network as well as external endpoints. That in and of itself is a lot to manage so we try to keep things as generic as possible w/o having to rely on too many third party NuGet packages that don't bring much to the table for us. Because of that, we rolled our own base service implementations and interfaces to fit our security and network requirements. They don't follow a specific design or organizational patterns other than separating concerns and decoupling key areas where we know potentially breaking changes have taken place in the past or are likely to take place. We do regularly re-evaluate our architecture and implementations to see if there are any new ideas/tech that may help us manage things more efficiently, but so far we have yet to find anything significant enough to warrant a complete redesign and rebuild. Typically what we'll do is change something like a series of classes over to records and make the corresponding downstream changes to properly utilize them.
@samehgenah8067
@samehgenah8067 7 ай бұрын
You always different👍
@sergiodaniel6656
@sergiodaniel6656 3 ай бұрын
TY so much!!!
@quanghungnguyen3018
@quanghungnguyen3018 7 ай бұрын
thanks a lot 😀
@50LEDBURY
@50LEDBURY 2 ай бұрын
where is the download link?
@n.sharma5810
@n.sharma5810 5 ай бұрын
Hi Patrick, can we implement repository in this example?
@martinzaloga3843
@martinzaloga3843 3 ай бұрын
I think that here the repo is represented by the DBContext class, which is injected to the command and query handlers, which are replacing the service. Is it more clear now? :-D
@baebcbcae
@baebcbcae Ай бұрын
try more complicated examples please, creating entity A requires automatic creation of entity B, it should be different commands but it must be atomic and it might be concurrent and result must be unique by field but you can't use unique index on DB... how you organise your handlers then ?
@nobuffer-indef
@nobuffer-indef 3 ай бұрын
awesome
@TheLUCKYONETutorials
@TheLUCKYONETutorials 7 ай бұрын
I get the idea. But it seems just like another layer of work and complexity. I dont think that I want to implement this every time I start a new project..
@wordlifejohn1122
@wordlifejohn1122 5 ай бұрын
You the 🐐
Intro to MediatR - Implementing CQRS and Mediator Patterns
1:21:50
IAmTimCorey
Рет қаралды 234 М.
We Attempted The Impossible 😱
00:54
Topper Guild
Рет қаралды 56 МЛН
Homelab Services Tour 2025 - What am I Self-Hosting
1:06:51
Techno Tim
Рет қаралды 88 М.
Why Every .NET Developer NEEDS Dependency Injection
10:00
Patrick God
Рет қаралды 14 М.
Domain-Driven Design: The Last Explanation You'll Ever Need
21:05
Software Developer Diaries
Рет қаралды 23 М.
CQRS Doesn't Have To Be Complicated | Clean Architecture, .NET 6
24:09
Milan Jovanović
Рет қаралды 120 М.
AI Is Making You An Illiterate Programmer
27:22
ThePrimeTime
Рет қаралды 289 М.
LINQ Tutorial for Beginners 🚀 Full Course
27:55
Patrick God
Рет қаралды 4 М.
What is CQRS ? | CQRS Design Pattern in Asp.Net Core
13:00
Nitish Kaushik
Рет қаралды 3,3 М.
All Rust string types explained
22:13
Let's Get Rusty
Рет қаралды 200 М.
Use Data Transfer Objects (DTOs) in .NET the Right Way 🚀
6:48