You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

15 lines
483 B

2 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. namespace SqlSugar
  4. {
  5. public interface ICacheService
  6. {
  7. void Add<V>(string key, V value);
  8. void Add<V>(string key, V value, int cacheDurationInSeconds);
  9. bool ContainsKey<V>(string key);
  10. V Get<V>(string key);
  11. IEnumerable<string> GetAllKey<V>();
  12. void Remove<V>(string key);
  13. V GetOrCreate<V>(string cacheKey, Func<V> create,int cacheDurationInSeconds=int.MaxValue);
  14. }
  15. }