public static List <CommonItemModel> ComboOptions(string tableName) { var version = HttpContext.Current.Session["Version"]; var cacheKey = "CodeTable." + tableName + "." + version; var responseBytes = (byte[])HttpContext.Current.Cache[cacheKey]; var ItemList = new List <CommonItemModel> { }; if (responseBytes == null || 0 == responseBytes.Length) { var strSql = String.Format("DECLARE @SQL NVARCHAR(2000) SELECT @SQL = Select_Sql FROM tbCOM_Code_Table WHERE Table_Name = '{0}' EXEC(@SQL)", tableName); responseBytes = Utils.Compress(Encoding.UTF8.GetBytes(JSONHelper.ToJson(DbHelperSql.Query(DbHelperSql.DefaultQueryConn, strSql).Tables[0]))); HttpContext.Current.Cache.Insert(cacheKey, responseBytes, null, System.Web.Caching.Cache.NoAbsoluteExpiration, TimeSpan.FromDays(30)); } ItemList = JSONHelper.FromJsonToAnonymousType(Encoding.UTF8.GetString(Utils.Decompress(responseBytes)), ItemList); return(ItemList); }