Closed remcoros closed 4 years ago
Test failures :(
That's weird, there shouldn't be any behavior change. I'll look into it when I get back home and add specific test cases.
Got it, let me know what you think.
I am also trying to use a composable setup. Changing Add to TryAdd will cause the configuration to be first-writer-wins (possibly from last-writer-wins?), while giving each call to AddMediatR()
the impression of being able to set the configuration with each invocation.
I suggest in addition to TryAdd
:
1) Add AddMediatR()
overload with no Assembly or Type parameter (passing new Assembly[0]
to main function)
1) The AddMediatR()
main function should not throw on !assemblies.Any()
1) The ServiceRegistrar.AddMediatRClasses()
function should be turned into an extension, staying in MediatR.Registration.ServiceRegistrar
to not break backwards compatibility and per jimmy's comment "I don't really want to expand the public API in the root namespace" in #60.
1) Add AddMediatRClasses()
overload for params Assembly[]
This allows stuff like
This is also the pattern used in MVC et al, to allow multiple calls to AddMvc() without ending up with duplicate registrations in the container.