Skip to content
This repository has been archived by the owner on Feb 15, 2023. It is now read-only.

Make ServiceCollectionExtensions.AddMediatRClasses public #60

Closed
BalassaMarton opened this issue Feb 7, 2019 · 3 comments · Fixed by #68
Closed

Make ServiceCollectionExtensions.AddMediatRClasses public #60

BalassaMarton opened this issue Feb 7, 2019 · 3 comments · Fixed by #68

Comments

@BalassaMarton
Copy link

Use case: message handlers are in different projects (plugins), each having its own AddXXX method for single line configuration in the hosting project. The hosting project will not pass any assembly references to MediatR, as plugin registration is separated from infrastructure setup.

@jbogard
Copy link
Owner

jbogard commented Feb 7, 2019

How is the hosting project calling the configuration for the plugins? They all have to use the same service collection, right?

@BalassaMarton
Copy link
Author

Yes, each plugin has an AddXXX(this IServiceCollection) method, the host just composes the application by calling these registration methods, and then the plugins register their application parts and message handlers in the collection. Not that I can't write the same utility method (or copy it), but making the original public looks like a one-liner.

@jbogard
Copy link
Owner

jbogard commented Feb 8, 2019

I don't really want to expand the public API in the root namespace. However, I'd be open to moving that assembly scanning stuff outside to a sub-namespace and making it public.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants