2017-05-28 18:13:44 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
|
|
|
|
|
|
namespace SqlSugar
|
|
|
|
|
|
{
|
2017-09-28 15:50:14 +08:00
|
|
|
|
public interface ICacheService
|
2017-05-28 18:13:44 +08:00
|
|
|
|
{
|
2017-09-28 15:50:14 +08:00
|
|
|
|
void Add<V>(string key, V value);
|
|
|
|
|
|
void Add<V>(string key, V value, int cacheDurationInSeconds);
|
|
|
|
|
|
bool ContainsKey<V>(string key);
|
|
|
|
|
|
V Get<V>(string key);
|
|
|
|
|
|
IEnumerable<string> GetAllKey<V>();
|
|
|
|
|
|
void Remove<V>(string key);
|
2017-09-29 14:53:58 +08:00
|
|
|
|
V GetOrCreate<V>(string cacheKey, Func<V> create,int cacheDurationInSeconds=int.MaxValue);
|
2017-05-28 18:13:44 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|