/// <summary> /// Retrieves the List of Location Groups either from the Cache or Database /// </summary> /// <returns>Location Pool Ids and Names</returns> internal static List <LocationGroupHolder> GetAllLocationGroups() { var cacheKey = MarsV2Cache.MarsLocationGroupList; var cacheItem = MarsV2Cache.GetCacheObject(cacheKey); if ((ConfigAccess.ByPassCache()) || (cacheItem == null)) { cacheItem = ParameterDataAccess.GetAllLocationPools(); MarsV2Cache.AddObjectToCache(cacheKey, cacheItem); } return((List <LocationGroupHolder>)cacheItem); }
public List <string> GetLocationPoolList(string prefixText, int count) { if (_locationData == null) { _locationData = ParameterDataAccess.GetAllLocationPools(); } //Only return those that begin with the prefixText passed in var res = (from lg in _locationData where lg.LocationGroupName.ToLower().StartsWith(prefixText.ToLower()) select lg.LocationGroupName); return(res.Take(count).ToList()); }