public static DataMethodCompiled GetGlobalCompiledMethod(Guid MethodId) { lock (_lock) { DataMethodCompiled compiled; if (MethodCache.TryGetValue(MethodId, out compiled)) { return(compiled); } IDataMethodSetting DataMethod = Data.GlobalDb.DataMethodSettings.Get(MethodId); compiled = new DataMethodCompiled(DataMethod); MethodCache[MethodId] = compiled; return(compiled); } }
public static DataMethodCompiled GetCompiledMethod(SiteDb SiteDb, Guid MethodId) { Guid id = GetId(SiteDb, MethodId); lock (_lock) { DataMethodCompiled compiled; if (MethodCache.TryGetValue(id, out compiled)) { return(compiled); } // Global does not have site id. if (MethodCache.TryGetValue(MethodId, out compiled)) { return(compiled); } IDataMethodSetting DataMethod = SiteDb.DataMethodSettings.Get(MethodId); if (DataMethod != null) { compiled = new DataMethodCompiled(DataMethod); MethodCache[id] = compiled; return(compiled); } DataMethod = Data.GlobalDb.DataMethodSettings.Get(MethodId); if (DataMethod != null) { compiled = new DataMethodCompiled(DataMethod); MethodCache[MethodId] = compiled; return(compiled); } } return(null); }