public static object GetScalar(SqlCommand command) { CacheScalar item = GetCacheItem(GetIndexString(command)) as CacheScalar; if (item != null) { return(item.Value); } else { return(null); } }
public static void AddScalar(SqlCommand command, string tableNames, int expireTime, object value, int organizationID) { if (!GlobalCacheEnabled) { return; } CacheScalar item = new CacheScalar(); item.ExpiresOn = DateTime.Now.AddSeconds(expireTime); item.TableNames = GetTableNameList(tableNames); item.Value = value; item.OrganizationID = organizationID; HttpContext.Current.Application[GetIndexString(command)] = item; }