private object ResolveCore(Type type, string key) { key = GetKeyValueOrDefault(key); if (type == null) { type = ResolveType(key); if (type == null) { throw new IoCResolutionException("Failed to resolve type for " + key); } } ResolverDictionary resolvers; IResolver resolver = null; m_lockSlim.EnterReadLock(); try { if (m_typeDictionary.TryGetValue(type, out resolvers) && resolvers != null) { /* If the ResolveProperties method calls through here, it may be searching for a registration per * strongly-typed name that does not exist. In this case, just get the default registration. */ if (!resolvers.TryGetValue(key, out resolver)) { key = GetKeyValueOrDefault(null); resolver = resolvers[key]; } } } finally { m_lockSlim.ExitReadLock(); } if (resolvers == null) { return(BuildUp(type, key)); } if (resolver != null) { return(resolver.GetObject()); } return(BuildUp(type, key)); }