/// <summary> /// Apply the module to the component registry. /// </summary> /// <param name="componentRegistry">Component registry to apply configuration to.</param> public void Configure(IComponentRegistry componentRegistry) { if (componentRegistry == null) throw new ArgumentNullException("componentRegistry"); var moduleBuilder = new ContainerBuilder(); Load(moduleBuilder); moduleBuilder.Update(componentRegistry); AttachToRegistrations(componentRegistry); AttachToSources(componentRegistry); }
private void BuildScopeIfRequired() { if (!ShouldBuildScope) return; lock (sync) { if (!ShouldBuildScope) return; RegistrationCache.Clear(); var cb = new ContainerBuilder(); RegisterNew(cb); cb.Update(CurrentScope.ComponentRegistry); FactoryBuilders.Clear(); AutofacBuilders.Clear(); SimpleCache.Clear(); ServiceCache.Clear(); CacheWithArguments.Clear(); ShouldBuildScope = false; } }