I am trying to get the StructureMap 3 current container has follows:
public HomeController(IContainer injectedContainer) {
IContainer container = new Container();
var test1 = container.GetAllInstances(typeof(IMediator));
var test2 = injectedContainer.GetAllInstances(typeof(IMediator));
}
test1 returns nothing ... test2 returns a mediator instance.
So my StructureMap 3 configuration is working fine but in some places of my application I need to get the container manually. How can I do that?
I tried the following:
var test3 = ObjectFactory.Container.GetAllInstances(typeof(IMediator));
But this returns also an empty value.