public List <T> Search(ref ICacheStorage_WuQi <K, T> container, int adapter, Hashtable al, out int getall) { List <T> result = new List <T>(); getall = 0;//该策略没有缓存所有数据库数据,需要到数据库中查询。 return(result); }
public List <T> Search(ref ICacheStorage_WuQi <K, T> container, int adapter, Hashtable al, out int getall) { getall = 0;//该策略无缓存,需要再到数据库中查询。 List <T> result = new List <T>(); return(result); }
public bool Insert(K k, CCacheItem_WuQi <K, T> item, ref ICacheStorage_WuQi <K, T> container) { if (!container.Contains(k)) { container.Add(k, item); } return(true); }
public bool Delete(K k, ref ICacheStorage_WuQi <K, T> container) { if (container.Contains(k)) { container.Remove(k); } return(true); }
public int SynchronousAllObject(List <CCacheItem_WuQi <K, T> > litem, ref ICacheStorage_WuQi <K, T> container) { container.Clear(); foreach (CCacheItem_WuQi <K, T> item in litem) { container.Add(item.key, item); } return(container.Count); }
public CLogMsgContainer_WuQi(string conn, ICacheStorage_WuQi <uint, CLogMsg_WuQi> ics, ICacheDependency_WuQi <uint, CLogMsg_WuQi> icd) : base(ics, icd) { this.str_conn = conn; //首先清空数据库及缓存 Clear(); //获得数据库中做大的主键值 SetMaxGuid(); }
public int Delete(List <CCacheItem_WuQi <K, T> > listitem, ref ICacheStorage_WuQi <K, T> container) { foreach (CCacheItem_WuQi <K, T> item in listitem) { if (container.Contains(item.key)) { container.Remove(item.key); } } return(listitem.Count); }
public int Insert(List <CCacheItem_WuQi <K, T> > listitem, ref ICacheStorage_WuQi <K, T> container) { int result = 0; foreach (CCacheItem_WuQi <K, T> item in listitem) { if (!container.Contains(item.key)) { container.Add(item.key, item); } result++; } return(result); }
public T SelectSingleObject(ref ICacheStorage_WuQi <K, T> container, K k, out int getall) { if (false != container.Contains(k)) { getall = 1;//该数据已经查询到了,不在需要到数据库中查询了。 CCacheItem_WuQi <K, T> item = container[k]; //更新元素的访问数和最后访问时间 item.hits++; item.d_lastaccesstime = DateTime.Now; return(item.t_value); } else { getall = 0; } return(default(T)); }
/// <summary> /// 默认改造函数 /// </summary> public ObjectContainer_WuQi(ICacheStorage_WuQi <K, T> ics, ICacheDependency_WuQi <K, T> icd) { this.obj_dependency = icd; this.obj_containers = ics; this.obj_rwl = new System.Threading.ReaderWriterLock(); }
public void Clear(ref ICacheStorage_WuQi <K, T> container) { return; }
public int Delete(List <CCacheItem_WuQi <K, T> > listitem, ref ICacheStorage_WuQi <K, T> container) { return(listitem.Count); }
public bool Delete(K k, ref ICacheStorage_WuQi <K, T> container) { return(true); }
public bool Insert(K k, CCacheItem_WuQi <K, T> item, ref ICacheStorage_WuQi <K, T> container) { return(true); }
public int SynchronousAllObject(List <CCacheItem_WuQi <K, T> > litem, ref ICacheStorage_WuQi <K, T> container) { container.Clear(); return(container.Count); }
public T SelectSingleObject(ref ICacheStorage_WuQi <K, T> container, K k, out int getall) { getall = 0;//该策略无缓存,需要再到数据库中查询了。 return(default(T)); }
public void Clear(ref ICacheStorage_WuQi <K, T> container) { container.Clear(); }