Exemple #1
0
 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));
 }
Exemple #2
0
 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);
 }