Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
164
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1.         /// <summary>
  2.         /// First return cached result, then refresh this result with live value
  3.         /// </summary>
  4.         private void CacheRefreshAction()
  5.         {
  6.             CacheRefreshResult = string.Empty;
  7.  
  8.             //Fire task
  9.             //Will show loader in the UI
  10.             CacheRefreshDataLoader.LoadCacheThenRefreshAsync(() => DataCache.GetFromCache<string>("key6"), () => DataCache.GetAsync("key6", () => LongRunningOperation(DateTime.Now.Second.ToString()), expireDate: DateTime.Now.AddDays(1), forceRefresh: true), x =>
  11.             {
  12.                 CacheRefreshResult = x;
  13.             });
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement