Пример #1
0
 public ICollection <T> GetListItems()
 {
     if (_cache == null && _CACHEKEY == null)
     {
         return(_db.GetList());
     }
     else
     {
         var re = _cache.GetData <List <T> >(_CACHEKEY);
         if (re == null || re?.Count <= 0)
         {
             re = (List <T>)_db.GetList();
             if (re == null || re?.Count > 0)
             {
                 _cache.AddData(_CACHEKEY, re);
             }
         }
         return(re);
     };
 }