public static List <CoreCapabilitiesObject> GetCoreCapabilities(bool enabledOnly = false, int?requiredId = null) { var cache = HttpContext.Current.Cache; List <CoreCapabilitiesObject> data = (List <CoreCapabilitiesObject>)cache[CoreCapabilitiesKey]; if (data == null) { data = CoreCapabilitiesObject.GetCoreCapabilitiess(); cache.Insert(CoreCapabilitiesKey, data, null, DateTime.Now.AddMinutes(60), Cache.NoSlidingExpiration); } return(data.Where(n => (!enabledOnly || n.Active || (requiredId.HasValue && n.CoreCapabilitiesId == requiredId.Value))).ToList()); }