public object GetObject(Type pluginType, Instance instance, ILifecycle lifecycle) { if (instance is IValue) { return(_resolver.BuildNewInSession(pluginType, instance)); } if (lifecycle is UniquePerRequestLifecycle) { return(_resolver.BuildUnique(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]); }