internal void DoSetInstance(ObjectDescription description, LifetimeScopeWithParent currentScope, object instance)
        {
            if (_cachedInstances == null)
            {
                _cachedInstances = new Dictionary <ScopedInstanceKey, object>();
            }
            var key = new ScopedInstanceKey(description, currentScope);

            _cachedInstances.Add(key, instance);
        }
        internal object DoGetInstance(ObjectDescription description, LifetimeScopeWithParent currentScope)
        {
            if (_cachedInstances == null)
            {
                return(null);
            }
            var    key = new ScopedInstanceKey(description, currentScope);
            object instance;

            return(_cachedInstances.TryGetValue(key, out instance) ? instance : null);
        }
 public ScopedInstanceKey(ObjectDescription description, LifetimeScopeWithParent currentScope)
 {
     _description  = description;
     _currentScope = currentScope;
 }
 protected LifetimeScopeWithParent(Kernel kernel, LifetimeScopeWithParent parentScope)
     : base(kernel)
 {
     _parentScope = parentScope;
 }