public ActionResult TablesJson(string dbName, string connectionStringName = "SqlServerHelper") { IEnumerable <TablesView> list_tables = null; string connectionString = ConnectionString.connectionString(connectionStringName); if (!string.IsNullOrWhiteSpace(connectionString)) { list_tables = CacheHelper.GetCache(connectionString + "_Table_" + dbName) as IEnumerable <TablesView>; if (list_tables == null || list_tables.Count() <= 0) { list_tables = homeDA.GetTables(dbName, connectionStringName); CacheHelper.SetCache(connectionString + "_Table_" + dbName, list_tables, TimeSpan.FromHours(2)); } } return(Json(list_tables, "text/plain", JsonRequestBehavior.AllowGet)); }