Enable Scrutor to use external DI
See original GitHub issueWe had DI running for quite some time now using the standard microsoft implementation. Due to several reasons (one beeing https://github.com/aspnet/AspNetCore/issues/2737) we now move to SimpleInjector (which we used on legacy WebApi projects alot).
Now SimpleInjector does not have rich assembly scanning support and states
Although many other DI libraries contain an advanced API for doing convention based registration, we found that doing this with custom LINQ queries is easier to write, more understandable, and can often prove to be more flexible than using a predefined and restrictive API.
I can totally accept this, however we are now sitting infront of quite some Scrutor lines which did this heavy lifting for us.
Something that would now have been really cool is to still be able to use Scrutor but inject a custom RegistrationStrategy
which under the hood would not do services.Add
but instead a custom action like container.Register
. (SimpleInjector even has some code under the hood which turns ServiceDescriptor
objects into SImpleInjector registrations).
Does this make any sense or is it completely out of the scope of this project?
Thanks, Philipp
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top GitHub Comments
Closing - thanks for the help, everything worked out today just nicely.
This is btw. what seems to work ok for now for us. There is quite a few cases not considered here (which were not relevant to us).
ImplementationType
do work (We did not use anything else like factories - atleast not via Scrutor)