Replace MediatR with source-generated Mediator across application and tests#1406
Open
Copilot wants to merge 3 commits into
Open
Replace MediatR with source-generated Mediator across application and tests#1406Copilot wants to merge 3 commits into
Copilot wants to merge 3 commits into
Conversation
Agent-Logs-Url: https://github.com/DevBetterCom/DevBetterWeb/sessions/ecf5bfb1-07ce-4dbb-8be3-2a57358deb71 Co-authored-by: ardalis <782127+ardalis@users.noreply.github.com>
Agent-Logs-Url: https://github.com/DevBetterCom/DevBetterWeb/sessions/ecf5bfb1-07ce-4dbb-8be3-2a57358deb71 Co-authored-by: ardalis <782127+ardalis@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Replace MediatR with generated Mediator implementation
Replace MediatR with source-generated Mediator across application and tests
May 12, 2026
ardalis
approved these changes
May 12, 2026
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.
This issue replaces runtime MediatR wiring with source-generated Mediator. The change updates dependencies and mediator integration points so command/query/notification flow uses Mediator abstractions and generated registrations.
Dependency migration
MediatRpackage usage with:Mediator.AbstractionsMediator.SourceGenerator(host project)Directory.Packages.propsaccordingly.Mediator API and namespace transition
using MediatR;tousing Mediator;in core, infrastructure, web, and functional test code paths.Send,Publish) while moving to Mediator interfaces.DI registration update (source-generated setup)
AddMediatR(...)withAddMediator(...).Infrastructure naming alignment
MediatRDomainEventDispatchertoMediatorDomainEventDispatcher.Example of the new registration pattern:
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
api.cdnjs.com/usr/share/dotnet/dotnet /usr/share/dotnet/dotnet /usr/share/dotnet/sdk/10.0.201/MSBuild.dll /noautoresponse /nologo /nodemode:1 /nodeReuse:true /low:false(dns block)/usr/bin/dotnet dotnet test tests/DevBetterWeb.FunctionalTests/DevBetterWeb.FunctionalTests.csproj --filter FullyQualifiedName~NoOpMediator(dns block)If you need me to access, download, or install something from one of these locations, you can either: