Investigate decoupling Wolverine from Lamar
- Would depend on making assumptions about other container behavior. Might use Lamar strictly to "plan" using the otherwise built in
ServiceCollection
Honestly, right now this looks like the limitation might be "Lamar or the built in DI container". To use other containers, we'll need to possibly force Wolverine into a "stupid, service locator all the things" mode. I'm unenthusiastic. I'd rather have Wolverine be good with a limitation on IoC container choice than be possible to be mediocre with whatever else is out there.
I would support a global setting in Wolverine to enforce DI (and basically make Lamar obsolete in this case).
The result of enabling setting XY globally would be
- Always create a nested container / scope per Message
- Always create a nested container / scope per HTTP request
- Resolve all dependencies from DI container (besides the things like IMessageContext)
Whether Lamar is still required then doesn't really matter to me. But having a guaranteed strategy on how dependencies are resolved is important to me.
@Xzelsius I take pull requests.
I'm deeply unenthusiastic. I get that you've got the awkward EF Core thing to contend with, but I'm not willing to disable Wolverine this way.
This is complete in the 3.0 branch