private IEnumerable <ConfigurationSettingModel> GetSettings() { IEnumerable <ConfigurationSettingModel> configs = _cache.Get(nameof(ConfigurationSettingModel)) as IEnumerable <ConfigurationSettingModel>; if (configs != null) { return(configs); } configs = configurationSettingsService.GetConfigs(); _cache.CreateEntry(nameof(ConfigurationSettingModel)); _cache.Set(nameof(ConfigurationSettingModel), configs, new MemoryCacheEntryOptions { SlidingExpiration = TimeSpan.FromMinutes(10) }); return(configs); }
public IActionResult Get() { var settings = configurationSettingsService.GetConfigs(); return(Ok(settings)); }