コード例 #1
0
        /// <summary>
        /// Persists the specified key, value and expiration, updating it if the key already exists.
        /// </summary>
        /// <param name="key">The key.</param>
        /// <param name="value">The value.</param>
        /// <param name="expiresOn">The expire date after which this key is no longer valid.</param>
        public virtual void Set(string key, object value, DateTimeOffset?expiresOn = null)
        {
            var keyValueItem = new KeyValueItem(key, value, expiresOn);

            Set(keyValueItem);
        }
コード例 #2
0
 /// <summary>
 /// Removes the specified key value item.
 /// </summary>
 /// <param name="keyValueItem">The key value item to remove.</param>
 public virtual void Remove(KeyValueItem keyValueItem)
 {
     _realm.Write(() => Remove(keyValueItem));
 }
コード例 #3
0
 /// <summary>
 /// Persists the specified <code>KeyValueItem</code>, updating it if the key already exists.
 /// </summary>
 /// <param name="keyValueItem">The key value item.</param>
 public virtual void Set(KeyValueItem keyValueItem)
 {
     _realm.Write(() => _realm.Add(keyValueItem, true));
 }