Back to Browse

.NET 8 Microservices CQRS using MediatR

21.3K views
Jan 20, 2025
22:44

Learn how to implement the CQRS (Command Query Responsibility Segregation) pattern in .NET 8 Microservices using MediatR! 🚀 In this tutorial, we’ll explore how to design scalable and maintainable systems by separating read and write operations. Here’s what you’ll learn: ✅ What is CQRS and why is it important for microservices? ✅ Setting up a .NET 8 project with MediatR ✅ Defining Commands and Queries using MediatR ✅ Handling requests with Handlers for modular and testable code ✅ Real-world examples of CQRS in microservices ✅ Best practices for using MediatR effectively Chapters 0:00 - Introduction to the video 0:07 - Overview of the topic: CQRS and MediatR 1:01 - Creating a new project in Visual Studio 1:52 - Setting up the default Weather API 2:20 - Launching the API and Swagger page 2:47 - Refactoring the API to use MediatR 3:23 - Installing MediatR package 3:50 - Organizing folder structure 4:00 - Creating a repository for weather forecasts 5:06 - Implementing the repository interface 6:23 - Moving business logic to the repository 7:01 - Separating commands and queries with CQRS 7:32 - Adding query and command classes 9:02 - Implementing command and query handlers 11:01 - Implementing the Get Weather Forecast handler 13:06 - Implementing the Add Weather Forecast handler 15:00 - Refactoring the controller 16:00 - Injecting MediatR and handling requests 17:59 - Testing the GET and POST endpoints 21:49 - Conclusion and key takeaways 22:20 - Call to subscribe and end of video This video is perfect for developers looking to build clean and efficient microservices architectures with modern design patterns. Let’s simplify and streamline your application logic! 👍 Enjoyed this tutorial? Please like and subscribe for more content 👍 We’d love to hear your thoughts—please leave your feedback in the comments below! 💬 Have questions or feedback? Let us know in the comments, and we’ll be happy to help! #DotNet8, #Microservices, #CQRS, #MediatR, #DotNetDevelopment, #EventDrivenArchitecture, #LearnDotNet, #MicroservicesArchitecture, #SoftwareDesign, #DotNetTutorial

Download

0 formats

No download links available.

.NET 8 Microservices CQRS using MediatR | NatokHD