public void AddSqlList(String sql, IList objList) { if (objList == null) { return; } addList(sql, objList); CacheTime.updateList(sql); }
private void addList(String key, IList objList) { if (objList == null) { return; } addToContext(key, objList); foreach (IEntity obj in objList) { ContextCache.Put(CacheKey.getObject(obj.GetType(), obj.Id), obj); } CacheTime.updateList(key); }
private static void addList(String key, IList objList) { if (objList == null) { return; } foreach (IEntity obj in objList) { addToApplication(CacheKey.getObject(obj.GetType(), obj.Id), obj); CacheTime.updateObject(obj); // 加入缓存的时候,设置最新 timestamp } List <int> ids = new List <int>(); foreach (IEntity obj in objList) { ids.Add(obj.Id); } addToApplication(key, ids); CacheTime.updateList(key); }