Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /// <summary>
- /// First return cached result, then refresh this result with live value
- /// </summary>
- private void CacheRefreshAction()
- {
- CacheRefreshResult = string.Empty;
- //Fire task
- //Will show loader in the UI
- CacheRefreshDataLoader.LoadCacheThenRefreshAsync(() => DataCache.GetFromCache<string>("key6"), () => DataCache.GetAsync("key6", () => LongRunningOperation(DateTime.Now.Second.ToString()), expireDate: DateTime.Now.AddDays(1), forceRefresh: true), x =>
- {
- CacheRefreshResult = x;
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement