Replace mediatr with cortext.mediator#1111
Closed
Carl Sixsmith (carlsixsmith-moj) wants to merge 2 commits into
Closed
Replace mediatr with cortext.mediator#1111Carl Sixsmith (carlsixsmith-moj) wants to merge 2 commits into
Carl Sixsmith (carlsixsmith-moj) wants to merge 2 commits into
Conversation
d30197c to
5e5b55e
Compare
Contributor
Author
|
Tested:
|
5e5b55e to
149c8a9
Compare
2429649 to
abe14f9
Compare
abbe083 to
dcf1524
Compare
b6ba68b to
d36addc
Compare
baf4c4c to
5e5b0b4
Compare
344e955 to
8d23861
Compare
Post rebase fixes
5e5b0b4 to
d2f5558
Compare
15d1fd7 to
04c0b3c
Compare
04c0b3c to
15d1fd7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🔗 Related Work
📌 Summary
Replaces the MediatR package with Cortex.Mediator.
🎯 Purpose / Motivation
MediatR moved away from open source to a paid subscriber model.
🧠 Approach
Queries and Commands are now split for dedicated interfaces
🧪 How to Test
Requires a full system regression test.
Details:
This is a massive change and should not be merged until we are fully confident all issues are ironed out.
🙋 Notes for Reviewers
This pull request migrates the application from using MediatR to Cortex.Mediator as the in-process messaging library, updating dependencies, interfaces, and documentation accordingly. It also removes MediatR-specific exception handlers and introduces new compatibility and mediator infrastructure to support Cortex.Mediator. The changes affect package references, architectural documentation, key interfaces, and the dependency injection setup.
Migration from MediatR to Cortex.Mediator:
MediatRNuGet package withCortex.Mediatorin the solution's dependencies and removes MediatR from Renovate configuration. (Directory.Packages.props[1]src/Application/Application.csproj[2]renovate.json[3]Cortex.Mediatorand its types (ICommand<T>,IQuery<T>, etc.) instead of MediatR (IRequest<T>). (.github/copilot-instructions.md[1] [2] [3] [4].github/copilot-instructions.md[1]src/Application/Common/Validators/ValidationConstants.cs[2]Codebase and Interface Refactoring:
ICacheInvalidatorRequest<TResponse>now inherits fromICommand<TResponse>instead ofIRequest<TResponse>. (src/Application/Common/Interfaces/Caching/ICacheInvalidatorRequest.cssrc/Application/Common/Interfaces/Caching/ICacheInvalidatorRequest.csL3-R3)ICacheableRequest<TResponse>now inherits fromIQuery<TResponse>. (src/Application/Common/Interfaces/Caching/ICacheableRequest.cssrc/Application/Common/Interfaces/Caching/ICacheableRequest.csL3-R3)IAuditableRequest<TResponse>now inherits fromIQuery<TResponse>. (src/Application/Common/Interfaces/IAuditableRequest.cssrc/Application/Common/Interfaces/IAuditableRequest.csL4-L8)ICommanddocumentation to clarify distinction from mediator commands. (src/Application/Common/MessageBus/ICommand.cssrc/Application/Common/MessageBus/ICommand.csL6-R6)AbandonActivity) to use Cortex.Mediator command and handler types. (src/Application/Features/Activities/Commands/AbandonActivity.cs[1] [2]Mediator Infrastructure and Compatibility:
SequentialNotificationMediatorto ensure notifications are handled sequentially and integrates it as the application's mediator implementation. (src/Application/Common/Mediator/SequentialNotificationMediator.cs[1]src/Application/DependencyInjection.cs[2] [3]MediatorCompatibilityExtensionsto provide MediatR-like extension methods for Cortex.Mediator, aiding migration and compatibility. (src/Application/Common/Extensions/MediatorCompatibilityExtensions.cssrc/Application/Common/Extensions/MediatorCompatibilityExtensions.csR1-R38)Dependency Injection and Pipeline Behaviors:
src/Application/DependencyInjection.cssrc/Application/DependencyInjection.csR14-R45)Cleanup of MediatR-specific Exception Handlers:
DbExceptionHandler,ServerExceptionHandler,ValidationExceptionHandler). (src/Application/Common/Exceptions/DbExceptionHandler.cs[1]src/Application/Common/Exceptions/ServerExceptionHandler.cs[2]src/Application/Common/Exceptions/ValidationExceptionHandler.cs[3]