StructureMap.Pipeline.LifecycleObjectCache.Set C# (CSharp) Method

Set() public method

public Set ( Type pluginType, StructureMap.Pipeline.Instance instance, object value ) : void
pluginType System.Type
instance StructureMap.Pipeline.Instance
value object
return void
        public void Set(Type pluginType, Instance instance, object value)
        {
            if (value == null) return;

            _lock.Write(() => {
                int key = instance.InstanceKey(pluginType);
                if (_objects.ContainsKey(key))
                {
                    _objects[key] = value;
                }
                else
                {
                    _objects.Add(key, value);
                }
            });
        }