コード例 #1
0
        public SettingVM GetSiteSettings()
        {
            var siteSettings = _httpContext.CacheRead <SettingVM>(SiteSettingsKey);

            const int durationMinutes = 240;


            if (siteSettings != null)
            {
                return(siteSettings);
            }

            var result = _settingService.GetSetting();

            siteSettings = result.Data;
            _httpContext.CacheInsert(SiteSettingsKey, siteSettings, durationMinutes);

            return(siteSettings);
        }