public DependencyInjectionContainer CreateChildContainer(ChildContainerOptions childContainerOptions = default(ChildContainerOptions)) { return(new DependencyInjectionContainer(this, childContainerOptions)); }
private DependencyInjectionContainer(DependencyInjectionContainer parentContainer, ChildContainerOptions childContainerOptions) { Services = childContainerOptions.NewContainerServices ?? parentContainer.Services; _registrationMappings = childContainerOptions.DetachRegistrationMappingsFromParentContainer ? CreateCloneOfRegistrationMappings(parentContainer._registrationMappings) : parentContainer._registrationMappings; _resolveDelegates = childContainerOptions.DetachResolveDelegatesFromParentContainer ? Services.ConcurrentDictionaryFactory.Create <ResolveDelegateId, ResolveDelegate>() : parentContainer._resolveDelegates; Scope = Services.ContainerScopeFactory.CreateScope(parentContainer.Scope); }