A sample project demonstrating the implementation of Command Query Responsibility Segregation (CQRS) with MediatR in .NET.
This repository showcases the use of MediatR library to implement CQRS architecture in a .NET application. Command Query Responsibility Segregation is a design pattern that separates the read and write operations of a system, providing a scalable and maintainable solution.
- CQRS Implementation: Explore a clean and structured implementation of CQRS using the MediatR library.
- Command Handling: Learn how to handle commands to update the application state.
- Query Handling: Understand how queries are handled to retrieve data without affecting the write side.
- MediatR Integration: See how MediatR is integrated to simplify the handling of requests and notifications.
Ensure you have the following tools installed:
- .NET SDK 8
- Visual Studio or Visual Studio Code (optional, but recommended)
-
Clone the repository.
-
Open the solution in your preferred IDE.
-
Run the following commands in the terminal or command prompt:
dotnet restore dotnet ef database update
This will apply any pending database migrations.
-
Explore the different components in the project, including commands, queries, and handlers.
-
Run the application and see the CQRS pattern in action.
- .Net 8
- EF-Core
- MediatR
- Web API