public static void CacheEkle(string key, object value, int expireAsMinute) { if (_cache.Any(x => x.Key == key)) { _cache.Remove(key); } _cache.Add(key, value, DateTimeOffset.Now.AddMinutes(expireAsMinute)); }
public bool IsExist(string key) { System.Diagnostics.Contracts.Contract.Assert(!string.IsNullOrEmpty(key)); return(_cache.Any(i => i.Key == key)); }