github.com/DanielNogales/Sample.MediatR.CQRS ↗
CQRS with MediatR in ASP.NET Core 3.1
Open this visualization on its own page →
Contributors
1
Lines of Code
22
From
2021-06-10
To
2021-06-10
About DanielNogales/Sample.MediatR.CQRS
This project demonstrates how to implement the CQRS (Command Query Responsibility Segregation) pattern in ASP.NET Core 3.1 using the MediatR library. CQRS is a design pattern that separates read and write operations into distinct models, allowing commands to handle data mutations like inserts, updates, and deletes, while queries handle data retrieval. This separation of concerns makes applications more maintainable and scalable.
The implementation uses MediatR as a mediator to handle command and query requests, paired with Entity Framework Core using a code-first database approach. The sample is built as a Web API project, showing practical patterns for organizing request handlers, validators, and database operations in a clean architecture style. The code exemplifies how MediatR can decouple business logic from controllers, making the codebase easier to test and extend.
This is an educational reference project based on a detailed tutorial, intended for developers learning how to structure ASP.NET Core applications with modern architectural patterns and best practices for separating business concerns.