How "OrchardHostContainerRegistry" works?

Topics: Customizing Orchard, General, Writing modules
Jul 10, 2011 at 2:30 AM
Edited Jul 10, 2011 at 2:34 AM

Hi team,

  I noticed in "OrchardStarter.cs" file (as bellowing code section) , the "hostContainer" was registered in "OrchardHostContainerRegistry", but in "OrchardHostContainerRegistry"  class cannot find any public method to get the "OrchardHostContainerRegistry" instance.

  In some other classes can find "public IOrchardHostContainer HostContainer { get; set; }",  but "//MvcServiceLocator.SetCurrent(hostContainer);" was commented,  how "HostContainer " was injected?

             var hostContainer = new OrchardHostContainerRegistry(container);
            //MvcServiceLocator.SetCurrent(hostContainer);
            OrchardHostContainerRegistry.RegisterHostContainer(hostContainer);

            return container;

 

Thanks!

Coordinator
Jul 11, 2011 at 10:03 PM

Dependencies typically get injected through constructor parameters in Orchard.