/// <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); }
/// <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)); }
/// <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)); }