/// <summary> /// Returns all settings, cached for 10 min, returns null if no setting found. /// </summary> /// <returns></returns> /// <remarks> /// TODO needs to get only settings from meta. /// </remarks> private async Task <List <Meta> > GetAllSettingsAsync() { return(await _cache.GetAsync(CACHE_KEY_ALL_SETTINGS, new TimeSpan(0, 10, 0), async() => { return (await _repo.FindAsync(m => m.Type == EMetaType.Setting)).ToList(); })); }
/// <summary> /// Returns and caches all settings, returns null if no setting records found. /// </summary> private async Task <IEnumerable <Meta> > GetAllSettingsAsync() { return(await cache.GetAsync(KEY_ALL_SETTINGS, Time_All_Settings, async() => { return await metaRepository.FindAsync(m => m.Type == EMetaType.Setting); })); }