public string Get(PageEntity page, HttpRequestBase request) { var setting = GetSetting(); if (setting.Enable && (page.IsStaticCache ?? false) && !request.IsAuthenticated) { var data = _dataArchivedService.Get(GetCacheKey(page, request)); if (data != null && (setting.CacheHours == 0 || data.CreateDate.Value.AddHours(setting.CacheHours) > DateTime.Now)) { return(data.Data); } } return(null); }
public T Get <T>(string key) where T : class, new() { return(_settingCache.GetOrAdd(key, k => _dataArchivedService.Get <T>(k, () => new T())) as T); }
public T Get <T>(string key) where T : class, new() { return(_dataArchivedService.Get <T>(key, () => new T())); }
public AlipayService(IOptions <AlipayOptions> alipayOptions, IDataArchivedService dataArchivedService) { Options = dataArchivedService.Get(SettingKey, () => alipayOptions.Value); _aopClient = new DefaultAopClient(Options.Gatewayurl, Options.AppId, Options.PrivateKey, "json", "1.0", Options.SignType, Options.AlipayPublicKey, Options.CharSet, Options.IsKeyFromFile); }