private static IList getListFromCache(String queryKey, Type t) { if (CacheTime.isListUpdate(queryKey, t)) { return(null); } return(getFromContext(queryKey) as IList); }
//----------------------------------------------------------- internal IList getListFromCache(String queryKey, Type t) { if (CacheTime.isListUpdate(queryKey, t)) { return(null); } List <int> ids = appCache.Get(queryKey) as List <int>; if (ids == null) { return(null); } IList result = new ArrayList(); foreach (int id in ids) { IEntity obj = this.findOnePrivate(t, id); if (obj == null) { return(null); } if (CacheTime.isObjectUpdated(obj)) { return(null); // 如果有任何一个对象更新过,则缓存失效 } // 检查实体属性 renewEntityPropertyValue(obj); result.Add(obj); } logger.Debug("APP_cache_get=>" + queryKey); return(result); }