/// <summary> /// Constructs a new instance of the <see cref="Container"/> class. /// </summary> /// <param name="targets">Optional. The target container whose registrations will be used for dependency lookup /// when <see cref="Resolve(ResolveContext)"/> (and other operations) is called. If not provided, a new /// <see cref="TargetContainer"/> instance is constructed. This will ultimately be available to inherited types, /// after construction, through the <see cref="Targets"/> property.</param> protected Container(IRootTargetContainer targets = null) { _scope = new NonTrackingContainerScope(this); Targets = targets ?? new TargetContainer(); #if !ENABLE_IL_EMIT _cache = new ConcurrentCache(GetWorker); #else _dynCache = DynamicCache.CreateCache(this); #endif }