public DataTable GetDataTable() { DataTable result; if (CacheSettings.Enabled) { string queryKey = GetQueryCacheKey(); if (CacheSettings.Flush) { QueryCache.Remove(queryKey); } result = QueryCache.Get(queryKey); if (result == null) { result = GetDataTableDirectlyFromDatabase(); QueryCache.Set(queryKey, result, CacheSettings.ExpirationType, CacheSettings.ExpirationTime); } } else { result = GetDataTableDirectlyFromDatabase(); } return(result); }
public void Flush() { string queryKey = GetQueryCacheKey(); QueryCache.Remove(queryKey); }