Bala murugan

Bala murugan

  • NA
  • 76
  • 2.2k

How to use Redis cache in Web Api with repository

Feb 5 2018 5:13 AM
am new in Redis cache implementation and got in simple example with getstring from Redis Cache which is working fine. But the Same time I didn't get any idea about Set and get list values through Redis.
 
I have Using Provider and Repository. Please help me how to further proceed...
  1. public List<Article> GetArticleListBySectionName(string sectionName, int RegionId, int Count, int CacheTime, string cacheKey, bool cacheEnable = falsestring expiryInMinutes = "NoExpiry")  
  2. {  
  3. {  
  4. cacheKey = GetCacheKey(cacheKey, Convert.ToString(sectionName));  
  5. List<Article> _article = _cacheProxy.Get<List<Article>>(cacheKey);  
  6. if (_article != null)  
  7. {  
  8. _article = _articleRepositary.GetArticleListBySectionName(sectionName, RegionId, Count, CacheTime);  
  9. _cacheProxy.Store<List<Article>>(_article, cacheKey, expiryInMinutes);  
  10. }  
  11. return _article;  
  12. }  
  13. }  
Here _cacheProxy.Get and _cacheProxy.Store getting null values..While executing this, I ll getting error page

Answers (1)