Beispiel #1
0
        /// <summary>Sets the value of the given key within the cache. If an entry with the given key already exists, its expiration time will
        /// be reset. This method does not need to be called within the context of a <see cref="System.Transactions.Transaction"/>, but if there
        /// is a current transaction, it will be used.
        /// </summary>
        public void Set(TKey key, TValue value)
        {
            TransactionState state = GetWriteState();

            if (state == null)
            {
                Merge(key, value);
            }
            else
            {
                state.Set(key, value);
            }
        }