ICache.cs 924 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Threading.Tasks;
  3. using System.Collections.Generic;
  4. namespace YiSha.Cache.Interface
  5. {
  6. public interface ICache
  7. {
  8. bool SetCache<T>(string key, T value, DateTime? expireTime = null);
  9. T GetCache<T>(string key);
  10. bool RemoveCache(string key);
  11. #region Hash
  12. int SetHashFieldCache<T>(string key, string fieldKey, T fieldValue);
  13. int SetHashFieldCache<T>(string key, Dictionary<string, T> dict);
  14. T GetHashFieldCache<T>(string key, string fieldKey);
  15. Dictionary<string, T> GetHashFieldCache<T>(string key, Dictionary<string, T> dict);
  16. Dictionary<string, T> GetHashCache<T>(string key);
  17. List<T> GetHashToListCache<T>(string key);
  18. bool RemoveHashFieldCache(string key, string fieldKey);
  19. Dictionary<string, bool> RemoveHashFieldCache(string key, Dictionary<string, bool> dict);
  20. #endregion
  21. }
  22. }