Ejemplo n.º 1
0
        public static CacheBody <T> GetInstance()
        {
            if (_instance == null)
            {
                lock (locker)
                {
                    if (_instance == null)
                    {
                        _instance = new CacheBody <T>();
                    }
                }
            }

            return(_instance);
        }
Ejemplo n.º 2
0
 public static void Update <T>(string key, T value, int expireSec = 0)
 {
     CacheBody <T> .GetInstance().Update(key, value, expireSec);
 }
Ejemplo n.º 3
0
 public static T GetOrCreate <T>(string key, Func <T> create, int expireSec)
 {
     return(CacheBody <T> .GetInstance().GetOrCreate(key, create, expireSec));
 }
Ejemplo n.º 4
0
 public static void Remove <T>(string key)
 {
     CacheBody <T> .GetInstance().Remove(key);
 }
Ejemplo n.º 5
0
 public static IEnumerable <string> GetAllKey <T>()
 {
     return(CacheBody <T> .GetInstance().GetAllKey());
 }
Ejemplo n.º 6
0
 public static T Get <T>(string key)
 {
     return(CacheBody <T> .GetInstance().Get(key));
 }
Ejemplo n.º 7
0
 public static string Get(string key)
 {
     return(CacheBody <string> .GetInstance().Get(key));
 }
Ejemplo n.º 8
0
 public static bool ContainsKey <T>(string key)
 {
     return(CacheBody <T> .GetInstance().ContainsKey(key));
 }
Ejemplo n.º 9
0
 public static void Add <T>(string key, T value, int expireSec = 0)
 {
     CacheBody <T> .GetInstance().Add(key, value, expireSec);
 }