Method UpdateAsync
UpdateAsync(TKey, TValue, UpdatePolicy, IEnumerable<string>, CancellationToken)
Updates an existing object in the cache.
public Task<CacheResponse<TKey, TValue>> UpdateAsync(TKey key, TValue value, UpdatePolicy updatePolicy = null, IEnumerable<string> tags = null, CancellationToken cancellationToken = default)
Parameters
keyTKeyIdentifier of the object in the cache.
valueTValueValue to be stored in the cache.
updatePolicyUpdatePolicyPolicy changes to make to the object in the ScaleOut service. If null, the policy is left unchanged.
tagsIEnumerable<string>Collection of tags to associate with the object. All tags are replaced with the provided collection. Pass null to leave current tags in place. An empty collection clears current tags.
cancellationTokenCancellationTokenA token used to propagate notification that this operation should be canceled.
Returns
- Task<CacheResponse<TKey, TValue>>
A CacheResponse<TKey, TValue> containing the outcome of the operation.
Remarks
The Result property of the response will contain one of the following ServerResult outcomes:
| ServerResult | Description |
|---|---|
| Updated | The object was successfully updated in the ScaleOut service. |
| NotFound | The requested object was not found in the ScaleOut service. |
This operation does not use locking and will bypass locks on objects held by other clients/threads.