Clean ASP.NET Core API using MediatR and CQRS | Setup
Вставка
- Опубліковано 1 гру 2019
- Become a Patreon and get source code access: / nickchapsas
Check out my courses: dometrain.com
Hello everybody I'm Nick and in this ASP.NET Core tutorial I will show you how you can use CQRS and MediatR to clean up your applications. I will briefly explain what CQRS and the Mediator patterns are and how they apply in our use-case. The I will show you how you can use the MediatR package to decouple your API layer from your application layer, leading to more testable and manageable code.
Don't forget to comment, like and subscribe :)
Social Media:
Follow me on GitHub: bit.ly/ChapsasGitHub
Follow me on Twitter: bit.ly/ChapsasTwitter
Connect on LinkedIn: bit.ly/ChapsasLinkedIn
#aspnetcore #mediatr #cqrs #tutorial
I don't think I could have gotten such a clear explanation of this pattern anywhere else on the web.
Thanks Nick !
You can't imagine how happy I am after watching this video! Thank you.
Great starting tutorial with enough introduction theory, I never used MediatR or even mediator pattern (been stuck at legacy project)
And I really like how MediatR effortlessly made implementing of query and command almost trivial in CQRS pattern.
Keep the excellent videos coming and keep coding.
PS: your videos are worth more than price of coffee to see the source
I pressed like and subscribed by just watching the first 8 mins of this video, it's one of the best explanations without going full-blown detail yet I understand the main concept! well done!
nick, tim corey and les jackson, all create amazing dotnet content for free and helping me out a lot!
Perfect for whom wanna to start and get into MediatR and CQRS , keep up the great work man
did you find the project repo on github or not?
Video from 2019 and still applies today. This was very well explained. Thank you!
Love your content Nick. I'm just a newbie but learning a lot with your videos! Greetings from Perú!
Great video! Maybe because I setup my project almost identitcal. I'm loving how the code is so organized and clean!
Really good explanation and the demo was great, not too much not too less, really good balance. Thanks!
really really great tutorial. I was able to follow along and everything working as expected. wow!
best video regarding MediatR and CQRS I could find! Thanks a lot!
What an explanation, easily understood. Thanks for the video..
this is one of the best tutorials on CQRS.
I really enjoy watching your videos, very interesting tops and very clear explanation, Thanks you so much for all your efforts.
we wait all your newly tutorials.
Awesome content! You are a great teacher. Keep up the great work. I subscribed and look forward to more videos.
Wow!
Thanks so much for the wonderful video. Keep 'em coming!
Thank you very much for the awesome series.
Please keep it up.
Nice presentation and implementation. Thank you.
As simple as that.. The best one ever !! Thanks!!
This is exactly what I was looking for, Thanks @Nick Chapsas
Thanks Nick. Beautifully explained.
really great tutorial! cant wait for part 2!
Great tutorial, awesome explanation. Thank you so much for providing the source code.
How to get the source code of this tutorial
Great and simply explained. Thanks!
Brilliant tutorial! This is very clear, thank you :)
Nick before this video , i tried learning with the use of Event source but explanation was vague/not clear.Your video gave lot of confident in terms of implementation...Thanks a lot Nick, i subscribed too :)
Excellent video Nick! Keep up the great work.
This was great tutorial, thank you for sharing it with us.
Thanks for that tutorial. Very clearly described what to use and how. I've liked that CQRS pattern :D You deserve sub and like :)
At my last job, we created our own implementation of this (I didn't know about mediatr). It worked very well and was very clean, the only downside was that we didn't do any scanning, so we had to manually map all of our query/commands and responses. We had a giant wall of them. 🙃 Mediatr looks like it would have made life a fair bit easier!
Thank you man! You really help me to understand
amazing explanation, keep it up, thank you.
Excellent video! Thanks for this!
Its clear! You really did a good job .👍🏼😊
Fantastic explanation, well done!
Excellent explanation. I love it
Thank You for this tutorial:) It seems pretty easy now:)
Finally long time search ended here :)
Very neat and clean explanation
Thanks a lot for this beautiful explanation.
Good Luck.
this class is very helpful for beginner .. think you sir
Love the way you explained and it's really easy to understand. Thanks a lot, keep the amazing work.
Thank you very much! The tutorial was awesome !!
Such an amazing video. Thanks very much.
Very Elaborate, thanks Nick.
Perfectly explained. Now i can implement this. Thank you. ☺️
Perfect and Cool Explanation .. Thanks sir :)
So helpful. Thank you, sir.
Good Video. It helped me to understand CQRS.
Great video and very nice explanation
crazy good intro, thank you very much!
edit: subscribed :D
Very good bro.. Tks for sharing.
Well explained cover everything in this video 👍
Great tutorial, thank you
Good article !! Thank you ..
Very clear thank you
Nice video, keep up the good work!
Thank You Mr. Chapsas
No doubt you are really great .🙏
thanks a lot, keep up the good work.
00:00 : Introduction
00:22 : Mediator
02:25 : CQRS
05:27 : Design Overview
06:45 : Coding
great tutorial. thanks a lot
Thank you very much. It`s great.
Thank you so much.. I was going through all over to understand the MediatR and this extremely helped me.
Most excellent tutorial.
You’re the best, man!🙏
very nice explanation
thanks! clear explination
In general this is partly the evolution from a generic service response model to send from services to controllers. I noticed that in some cases when a controller returns multiple http statuses and messages depending on conditions there is an overlap in what you want to return from the service and the return value from the controller. The generic service response model then gets a kind of mapping which makes it confusing. So e.g. if the controller returns status xx1, xx2, xxx3, xxx4, xx5 depending on conditions with different (translated) messages when are only known in the service layer in terms of "content" for the message, there needs to be a mapping somewhere between what the service returns and the controller returns. So in the end the generic model returns a model with e.g. enums or something alike but then the mapping to what http status and which translated message then gets returned (which is more difficult if they are dynamic so not a lookup) is in terms of placement still dependent on what gets being send. (for everything that is generic its easy because you could handle that in a filter or middleware)
That's what error filters are for to translate service exceptions or whatever to proper return statuses. No need to re-invent the wheel with enums or whatever.
Your explanation made it easy to understand. Thank You!
#JetBrainsRider
Great work, very usueful.
You deserve more subscribers!
simple and clear
WOW Nick Chapsas what a nice formation , subscribed!!!! and also can we get the full project to follow along? like how to create the api you created and then add mediator to it?
MediatR is beautiful. I loved it. Great explanation. Very helpful. Thanks a lot for the video
Nice and sweet, sounds perfect, currently in mi job I have like 30 services and repos for every controller..... that is super dirty.
Love your videos! Would be awesome if you shared your Visual Code settings and making a guide for most common commands etc!
This is not visual studio code but rather JetBrains Rider
Thank you very much
Excellent! Very easy to follow. Well articulated.
Just amazing stuff... 👍🏼
I'm almost about to try using MediatR at least by itself on my amateurish MVC app but I'm reluctant about over-engineering it? What's your take on over-engineering vs following design patterns and best practices? Hope you come up with a video discussing it. Thanks!
so good!!!, Tx tx
Very interesting!
Beautiful!
This is the best explanation in the entire galaxy. Nick which tool/device did you use to draw that way?
Thanks David! I am using a Microsoft Surface Pro 7 with the Surface pen to draw and the Whiteboard app that comes with the Surface
Love those patterns, where for simple get request to fetch some data by primary key I need to create 10 intermediate classes
Love those programmers that take every single pattern as a Holy Grali and think it should be applied to etery single case they face.
Inb4: Nick provided us with easy to understand example just because it is easy to understand, and not because it is meant to be used in such a simple scenario...
really nice explanation; I have been looking for a good example of mediatR since ages.
Thank you
thank you!!!
Ty, dude.
This is a really great explanation - nice work, great content.
Be nice if you could had some tests around the handlers. Been trying to find these for a while now
Nice. Probably makes sense to create a BaseOrderHandler that injects all those in the ctor so as to not have to duplicate that effort in each handler class?
Hi, I am new to your channel just subscribe after watching this video. It was actually really good.
I want to make a few suggestions, please consider if you can,
- Your speed is quite fast so try to explain more.
- The content was really good but at some point, I didn't get the point, I am like what's going on and then repeat the section of the video.
Thanks for your good work.
Quality video!
Hi Nick, thanks for your video, that is cool. Please could you say few words about commands should or should not return a entity or so except of result like new entity ID for example. Thank you
Nick it would be nice if you could talk about event sourcing and CQRS together
Where can i get the source code, i cant find it in your github.
you are the best
Nice explanation!
I am curious to know what whiteboard drawing software are you using ?