PutAsync Method
PutAsync(TKey, TValue)
Sets (adds or updates) an entry, and returns the previous value, if any.
Declaration
Task<TValue> PutAsync(TKey key, TValue value)
Parameters
| TKey | key | The key. |
| TValue | value | The value. |
Returns
| Task<TValue> | The previous value for the specified key, if any; otherwise |
PutAsync(TKey, TValue, TimeSpan)
Sets (adds or updates) an entry with a time-to-live, and returns the previous value, if any.
Declaration
Task<TValue> PutAsync(TKey key, TValue value, TimeSpan timeToLive)
Parameters
| TKey | key | The key. |
| TValue | value | The value. |
| TimeSpan | timeToLive | A time-to-live period. |
Returns
| Task<TValue> | The previous value for the specified key, if any; otherwise |
Remarks
The value is automatically expired, evicted and removed after the
timeToLive has elapsed.