IUnityContainer single instance

Nov 20, 2009 at 2:05 AM
Edited Nov 20, 2009 at 2:06 AM

When you resolve instances, are all the UnityContainer the same?  For example in below...are all the "container"'s the same?

IUnityContainer container = new UnityContainer();
var controller = container.Resolve<ClassA>();

public class ClassA
{
    private IUnityContainer _container;
    
    public ClassA(IUnityContainer container)
    {
        _container = container.Resolve<ClassB>();
    }  
}

public class ClassB
{
    private IUnityContainer _container;

    public ClassB(IUnityContainer container, ISomeInterface interface)
    {
      _container = container;        
    }
}
TIA,
Mike
Nov 20, 2009 at 2:26 AM

Yes, they're the same.