public virtual List <T> ListCache(string cacheName, CacheTimeType cacheTimeType, int cacheTime) { if (!CacheExtensions.CheckCache(cacheName)) { CacheExtensions.SetCache(cacheName, (object)this.dbset.AsNoTracking <T>().ToList <T>(), cacheTimeType, cacheTime); } return(CacheExtensions.GetCache <List <T> >(cacheName)); }
public virtual List <T> ListCache(string cacheName, CacheTimeType cacheTimeType, int cacheTime, Expression <Func <T, bool> > where, int count) { if (!CacheExtensions.CheckCache(cacheName)) { CacheExtensions.SetCache(cacheName, (object)this.dbset.AsNoTracking <T>().Where <T>(where).Take <T>(count).ToList <T>(), cacheTimeType, cacheTime); } return(CacheExtensions.GetCache <List <T> >(cacheName)); }
private static void SetCache(this LoginInfo loginInfo) { CacheExtensions.SetCache(LoginCacheName + loginInfo.ID, loginInfo, CacheTimeType.ByMinutes, 10); }