Repository navigation
Replies: 2 comments 4 replies
|
"How should we be handling this?" -- don't do that is my best suggestion. And I say that too as the author of the original production worthy IoC container in .NET as well as being the tech lead of Wolverine. Switching this to a Discussion |
0 replies
|
The current behavior for Microsoft DI and also for Lamar is to use the greediest constructor, or at least the greediest reachable. Why would Wolverine go the other way? https://jasperfx.github.io/lamar/documentation/ioc/registration/constructor-selection/ |
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
We are getting started with Wolverine and just ran into a major roadblock for us. We are running .NET 10 with EF Core and minimal APIs. Some of our classes have multiple constructors, typically a partial class that was generated with "core" constructors like ILogger and a DbContext and then those constructors have been extended in another partial class. Wolverine always seems to choose the constructor that has the fewest arguments and then the other objects are null and throw an exception. We have tried a few things like [DefaultConstructor] and nothing has worked.
How should we be handling this?
All reactions