This PR refactors the codebase to implement the Command Query Responsibility Segregation (CQRS) and MediatR pattern. The CQRS pattern separates the read and write operations for a data store, while MediatR is used as a mediator to decouple in-process messaging. This refactor improves the codebase's maintainability, scalability, and performance.
Summary of Changes
Added MediatR library as a dependency to the project.
Created commands and queries for the User model to encapsulate write and read operations.
Implemented handlers for the User commands and queries to perform the corresponding operations.
Modified the UsersController to use MediatR to send commands and queries instead of directly interacting with the User model.
Created unit tests for the User command and query handlers to ensure their correctness.
Please review and merge this PR to incorporate the CQRS and MediatR pattern into the codebase.
Fixes #3.
π Latest improvements to Sweep:
Sweep can now passively improve your repository! Check out Rules to learn more.
π‘ To get Sweep to edit this pull request, you can:
Comment below, and Sweep can edit the entire PR
Comment on a file, Sweep will only modify the commented file
Edit the original issue to get Sweep to recreate the PR from scratch
PR Feedback (click)
Description
This PR refactors the codebase to implement the Command Query Responsibility Segregation (CQRS) and MediatR pattern. The CQRS pattern separates the read and write operations for a data store, while MediatR is used as a mediator to decouple in-process messaging. This refactor improves the codebase's maintainability, scalability, and performance.
Summary of Changes
Please review and merge this PR to incorporate the CQRS and MediatR pattern into the codebase.
Fixes #3.
π Latest improvements to Sweep:
π‘ To get Sweep to edit this pull request, you can: