public async Task <ProducersModel> ListProducers() { if (!RedisCacheHelper.TryGetCache(ConfigDataKey.LatestProducerListCacheKey, out ProducersModel model) || model == null) { model = await GetListProducers(); } return(model); }
public async Task <BlockListModel> ListLatest() { if (!RedisCacheHelper.TryGetCache(ConfigDataKey.LatestBlockListCacheKey, out BlockListModel model) || model == null) { model = await GetListLatest(); } return(model); }
public HomeStatisticalModel HomeStatistical() { if (!RedisCacheHelper.TryGetCache(ConfigDataKey.LatestBlockCacheKey, out HomeStatisticalModel model) || model == null) { model = GetLatestStatistical(); } return(model); }
public List <TransactionRecordModel> ListLatest(int total) { if (!RedisCacheHelper.TryGetCache(ConfigDataKey.LatestTransactionListCacheKey, out List <TransactionRecordModel> list) || list == null) { list = GetListLatest(total); } return(list); }
private List <TokenAccountModel> GetTokenAccounts(string symbol, string code) { decimal symbolCode; try { symbolCode = Convert.ToDecimal(new SymbolCode(symbol).Value); } catch (Exception e) { return(new List <TokenAccountModel>()); } var cacheKey = GetTokenAccountsCacheKey(code, symbolCode); if (!RedisCacheHelper.TryGetCache(cacheKey, out List <TokenAccountModel> list) || list == null) { list = GetAccountsOfToken(code, symbolCode); } return(list); }
protected bool TryGetCache <TValue>(string key, out TValue result) { return(RedisCacheHelper.TryGetCache(key, out result)); }