Hi there,
I am pretty new to the Unity Application Block and am a little stuck trying to implement the following. I have a parent and child container. When i resolve a new instance of the child container i want to inject a new UnityContainer into the constructor using the CreateChildContainer method.
public class RootContainer
{
private IUnityContainer _container;
public RootContainer()
{
_container = new UnityContainer();
_container.RegisterType<IChildContainer, ChildContainer>();
}
}
public interface IChildContainer { }
public class ChildContainer : IChildContainer
{
private IUnityContainer _container;
/* I want to inject the parent.CreateChildContainer() into this constructor */
public ChildContainer(IUnityContainer container)
{
_container = container;
}
}