Beispiel #1
0
        /// <summary>
        /// 新增分頁鍵值至Cache
        /// </summary>
        /// <param name="pageKey">分頁鍵值</param>
        protected void Append(string pageKey)
        {
            if (!_sectionCacheStorage.HasData(SectionKey))
            {
                _sectionCacheStorage.Set(SectionKey, new List <string> {
                    pageKey
                });
            }
            else
            {
                var pageKeys = _sectionCacheStorage.Get(SectionKey);

                if (!pageKeys.Contains(pageKey))
                {
                    pageKeys.Add(pageKey);

                    _sectionCacheStorage.Set(SectionKey, pageKeys);
                }
            }
        }
Beispiel #2
0
 /// <summary>
 /// 是否有資料
 /// </summary>
 /// <returns></returns>
 public bool HasData()
 {
     return(_cacheStorage.HasData(StorageKey));
 }