public dynamic getCachedData(String tableName, Int32 pageNumber) { //Debugger.Launch(); foreach (KeyValuePair <String, dynamic> kvp in cachedTables.Where(item => item.Key == (tableName + pageNumber.ToString())).ToList()) { TableCache tc = kvp.Value; if (tc.page == pageNumber) { return(tc.data); } } return(null); }
public void cacheTable(String tableName, Int32 pageNumber, dynamic data) { if (cachedTables.ContainsKey(tableName + pageNumber)) { bool validPage = false; while (!validPage) { pageNumber++; validPage = !cachedTables.ContainsKey(tableName + pageNumber); } } TableCache t = new TableCache(pageNumber, data); cachedTables.Add(tableName + pageNumber.ToString(), t); }
public void cacheTable(String tableName, Int32 pageNumber, dynamic data) { if (cachedTables.ContainsKey(tableName + pageNumber)) { bool validPage = false; while (!validPage) { pageNumber++; validPage = !cachedTables.ContainsKey(tableName + pageNumber); } } TableCache t = new TableCache(pageNumber, data); cachedTables.Add(tableName+pageNumber.ToString(), t); }