示例#1
0
        public async Task <TenantSettings> GetTenantSettingsAsync(string tenantCode)
        {
            var result = await _cache.GetOrCreateAsync($"{CacheConstants.TenantSettingsCachePrefix}{tenantCode}",
                                                       async (ce) => {
                ce.SlidingExpiration  = TimeSpan.FromSeconds(15);
                ce.AbsoluteExpiration = DateTime.Now.AddMinutes(5);

                var settings = await _tenantsRepository.GetTenantSettingsAsync(tenantCode);

                return(settings);
            });

            return(result);
        }