public object Get(Type pluginType, Instance instance, IBuildSession session)
        {
            var @object = session.BuildNewInSession(pluginType, instance);
            if (@object is IDisposable)
            {
                _tracked.Add(@object);
            }

            return @object;
        }
        public object Get(Type pluginType, Instance instance, IBuildSession session)
        {
            var @object = session.BuildNewInSession(pluginType, instance);

            if (@object is IDisposable)
            {
                _tracked.Add(@object);
            }

            return(@object);
        }
Esempio n. 3
0
        public object GetObject(Type pluginType, Instance instance, ILifecycle lifecycle)
        {
            if (instance is IValue)
            {
                return(_resolver.BuildNewInSession(pluginType, instance));
            }

            if (lifecycle is UniquePerRequestLifecycle)
            {
                return(_resolver.BuildNewInSession(pluginType, instance));
            }

            var key = instance.InstanceKey(pluginType);

            if (!_cachedObjects.ContainsKey(key))
            {
                var o = _resolver.ResolveFromLifecycle(pluginType, instance);
                _cachedObjects[key] = o;

                return(o);
            }

            return(_cachedObjects[key]);
        }
Esempio n. 4
0
        public object GetObject(Type pluginType, Instance instance)
        {
            if (instance.IsUnique())
            {
                return(_resolver.BuildNewInSession(pluginType, instance));
            }

            int key = instance.InstanceKey(pluginType);

            if (!_cachedObjects.ContainsKey(key))
            {
                object o = _resolver.ResolveFromLifecycle(pluginType, instance);
                _cachedObjects[key] = o;

                return(o);
            }

            return(_cachedObjects[key]);
        }
 protected override object buildWithSession(Type pluginType, Instance instance, IBuildSession session)
 {
     return(session.BuildNewInSession(pluginType, instance));
 }
 protected override object buildWithSession(Type pluginType, Instance instance, IBuildSession session)
 {
     return session.BuildNewInSession(pluginType, instance);
 }
Esempio n. 7
0
 public object Get(Type pluginType, Instance instance, IBuildSession session)
 {
     return(session.BuildNewInSession(pluginType, instance));
 }
Esempio n. 8
0
 public object Get(Type pluginType, Instance instance, IBuildSession session)
 {
     return session.BuildNewInSession(pluginType, instance);
 }