CQRS & MediatR | ASP.NET 6 REST API Following CLEAN ARCHITECTURE & DDD Tutorial | Part 6

Опубликовано: 31 Октябрь 2024
на канале: Amichai Mantinband
67,961
1.6k

Link to the full playlist:    • ASP.NET 6 REST API Following CLEAN AR...  

Become a Patreon & get the source code:   / amantinband  

Follow me on 'em socials:
Twitter:   / amantinband  
LinkedIn:   / amantinband  
GitHub: https://github.com/amantinband

What is this series?
We'll build a REST API following Clean Architecture & Domain-Driven Design principles completely from scratch.
We will use .NET 6, EF Core, and common patterns such as CQRS, unit of work, repository, mediator, and more 💪🏽
We'll also use some awesome open-source libraries such as MediatR, FluentValidation, ErrorOr, Throw, Mapster, and more.
The developing environment will be visual studio code & dotnet CLI only. We will use awesome vscode plugins for everything from sending HTTP requests to connecting to our SQL database, debugging, and peeking at JWT tokens.
We will code and refactor multiple times to tackle the many concepts I want to teach. When the series will be over, you'll have a good understanding and intuition on how to use these patterns & libraries in your industry-level applications.

How often will a new part come out?
Once or twice a week.

What are we doing today?
Today we'll split our application logic following the CQRS Design Pattern.
Then, we'll introduce the package MediatR which will play nicely with this Design Pattern and help us split our logic by feature, which will make the use cases in our application layer clear.

Give MediatR a ⭐:
https://github.com/jbogard/MediatR

#dotnet

00:00. CQS (Command Query Separation)
01:40. CQRS (Command Query Responsibility Segregation)
02:27. CQS & CQRS Misconceptions
03:18. Implementing CQRS
06:57. The Problem with CQRS in large systems
07:33. Splitting the logic by Feature
09:07. MediatR NuGet package
10:02. Implementing MediatR Command
11:35. Implementing MediatR Command Handler
13:07. Implementing MediatR Query
13:36. Implementing MediatR Query Handler
14:30. MediatR Dependency Injection
16:12. Using the Mediator object
16:34. Mediator pro tip
18:00. Domain Models with CQRS Query path