-
-
Notifications
You must be signed in to change notification settings - Fork 72
Open
Labels
Discussion 💬Inviting opinions on the subjectInviting opinions on the subjectNew Feature 🚀New feature requestNew feature requestby design ⚙️Behavior is as designedBehavior is as designed
Milestone
Description
Container defaults to internal constructor with more parameters over a public default constructor,
Expected behavior is that the public empty constructor should be used; i.e. internal constructor should be treated as private?
The following test fails.
[Test]
public void TestCtrSelection()
{
var uc = new UnityContainer();
uc.RegisterType<Service>();
uc.Resolve<Service>();
}
class CoreLogic
{
}
class Service
{
public CoreLogic Logic { get; private set; }
internal Service(CoreLogic cl)
{
Logic = cl;
Assert.Fail("Defaulted to internal ctr");
}
public Service()
{
Logic = new CoreLogic();
Assert.Pass();
}
}
xakep139
Metadata
Metadata
Assignees
Labels
Discussion 💬Inviting opinions on the subjectInviting opinions on the subjectNew Feature 🚀New feature requestNew feature requestby design ⚙️Behavior is as designedBehavior is as designed