示例#1
0
        public void Put(DbCacheKey key, DbCacheEntry value, DbCachingPolicy policy)
        {
            var cacheKey = BuildKey(key.Key);

            using (_cache.AcquireKeyLock(cacheKey))
            {
                _cache.Put(cacheKey, value, new CacheEntryOptions().ExpiresIn(policy.ExpirationTimeout.Value));

                foreach (var set in key.EntitySets)
                {
                    var lookup = GetLookupSet(set);
                    lookup.Add(cacheKey);
                }
            }
        }