public static RuntimeInfo Create(Type type, Dictionary <Type, RuntimeInfo> tempCache) { if (type == null) { return(null); } if ((type.IsValueType && !type.IsGenericType) || type == typeof(string)) { tempCache[type] = null; return(null); } RuntimeInfo existing = null; if (InternalCache.TryGet(type, out existing)) { return(existing); } if (tempCache.TryGetValue(type, out existing)) { return(existing); } RuntimeInfo runtimeInfo = null; tempCache[type] = runtimeInfo = new RuntimeInfo() { _type = type, _actionInfo = GetRuntimeActionForType(type) }; runtimeInfo._runtimeCollectionElementInfo = RuntimeInfo.Create(GetGenericCollectionElementType(type), tempCache); runtimeInfo._runtimeMembers = CreateRuntimeMemberInfo(type, tempCache).ToArray(); return(runtimeInfo); }
public static bool TryGet <T>(string key, out T value) { Check.Argument.IsNotNullOrEmpty(key, "key"); return(InternalCache.TryGet(key, out value)); }