If I have two constructors for a class, how does the service container choose which one to use when I\'m registering that service in ConfigureServices?
So lets say I
I tested it out with the following cases;
1 with an interface (registered), 1 with an interface and a primitive parameter (not registered)
public Application(ITestClass testClass)
public Application(ITestClass testClass, string message)
It choses the first one.
1 with an interface (registered), 1 with two interfaces (registered)
public Application(ITestClass testClass)
public Application(ITestClass testClass, ITestClass2 testClass2)
It choses the second one.
1 with an interface (registered), 1 with 2 interfaces (registered) and 1 primitive parameter (not registered)
public Application(ITestClass testClass)
public Application(ITestClass testClass, ITestClass2 testClass2, string message)
It choses the first one again.
When I registered the string type, it started to choose the second one.
So the long story short, it will try to find the most comprehensive one with the only known dependencies.