public DependencyContainerBuilder(HostUnityContainer unityContainer) { // this.InitializeServiceLocator(unityContainer); this.UnityContainer = unityContainer; this.TypeRegistrarService = new TypeRegistrarService(this.UnityContainer); // var scopeHostUnityContainer = new HostUnityContainer(); }
private void InitializeServiceLocator(IHostUnityContainer hostUnityContainer) { if (isServiceLocatorInitialized) { return; } ((IServiceLocatorInitializer)ServiceLocator.Instance).Initialize(hostUnityContainer); isServiceLocatorInitialized = true; }
void IServiceLocatorInitializer.Initialize(IHostUnityContainer hostUnityContainer) { if (hostUnityContainer == null) { throw new ArgumentNullException("hostUnityContainer"); } if (this.hostContainerInternal != null) { throw new Exception("ServiceLocator is already initialized"); } this.hostContainerInternal = hostUnityContainer; }