Manual Mediator Registration Issue (v3.0.1->v5.0.1)
See original GitHub issueFirst: Thank you very much for this awesome project, it has inspired me a lot and structures my project architecture so much better. Thanks!
I am currently migrating from the old version 3.0.1 to the latest 5.0.1.
Since I use the SimpleIoc
from the MvvmLight framework, this was how I registered and setup MediatR in version 3:
var ioc = SimpleIoc.Default;
ioc.Register<IAsyncRequestHandler<DoJobRequest>, DoJobUseCase>();
var mediator = new Mediator(
new SingleInstanceFactory(ioc.GetInstance),
new MultiInstanceFactory(ioc.GetAllInstances)
);
await mediator.Send(new DoJobRequest());
With version 5.0.1 and the removal of the MultiInstanceFactory
, I tried this (as described in the migration wiki):
var ioc = SimpleIoc.Default;
ioc.Register<IRequestHandler<DoJobRequest>, DoJobUseCase>();
var mediator = new Mediator(
new ServiceFactory(ioc.GetInstance)
);
await mediator.Send(new DoJobRequest());
But I get the error, that the IEnumerable<IPipelineBehavior<...>>
was not found…
How should I setup MediatR now to get it going again?
Thank you very much.
Issue Analytics
- State:
- Created 5 years ago
- Comments:18 (9 by maintainers)
Top Results From Across the Web
Untitled
... vega pics Implement the microservice application layer using the Web API Manual Mediator Registration Issue (v3.0.1->v5.0.1) #296 - GitHub Web30 dec.
Read more >Forms and Applications Used for Mediation
Most of the following forms can be completed online and printed. Forms and Applications Used for Mediation. Mentee Evaluation Form [Form ADR-1001] Word...
Read more >Mediation
The Mediation Information System is an online database used to capture information regarding court-referred mediations. The MIS system is for use by court ......
Read more >Mediator education & registration
In civil cases, a registered mediator must be an attorney in good standing with the Supreme Court of Indiana and must complete at...
Read more >Mediation | Superior Court of California - County of San Diego
Review the Mediator Application (CIV-023)PDF and Mediator ManualPDF to learn more about the panel requirements;; Submit your completed Mediator Application (CIV ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi, I’m in the same situation with splat container.
My solution :
Just replace _dependencyResolver with _ioc and add the folowing class:
I Hope it can help !
The problem that
IServiceLocator
is pretty much a dead end. A very old version of MediatR usedIServiceLocator
, but once that concept got abandoned, as did my usage of it.Interestingly, the new ASP.NET Core DI is just
IServiceProvider
, which has existed in .NET since…forever. Everything else is extension methods on that, or extensions likeIServiceScope