public static Type DefineInterfaceMethod(Type returnType, Type[] parameters) { // Reuse the previously cached results InterfaceInfo cacheKey = new InterfaceInfo(returnType, parameters); if (_cache.ContainsKey(cacheKey)) return _cache[cacheKey]; Type result = CreateInterface(returnType, parameters); // Cache the results if (result != null) _cache[cacheKey] = result; return result; }
public static Type DefineInterfaceMethod(Type returnType, Type[] parameters) { // Reuse the previously cached results var cacheKey = new InterfaceInfo(returnType, parameters); if (Cache.ContainsKey(cacheKey)) { return(Cache[cacheKey]); } var result = CreateInterface(returnType, parameters); // Cache the results if (result != null) { Cache[cacheKey] = result; } return(result); }