AddExclusive(TKey, TValue, CreatePolicy, IEnumerable<String>, CancellationToken)
Add an object in the cache and exclusively locks it, returning a CacheResponse<TKey, TValue> containing a lock token.
public CacheResponse<TKey, TValue> AddExclusive(TKey key, TValue value, CreatePolicy createPolicy = null, IEnumerable<string> tags = null, CancellationToken cancellationToken = default(CancellationToken))
Identifier of the object in the cache.
Value to be stored in the cache.
The policy to be associated with the new object.
Collection of tags to associate with the object. Pass null for no tags.
A token used to propagate notification that this operation should be canceled.
A CacheResponse<TKey, TValue> containing the outcome of the operation and a lock token that can be used for subsequent locking operations against the newly added object.
|Added||A new object was successfully added in the ScaleOut service and was left in a locked state.|
|AlreadyExistsError||The object could not be added because another object with the same key already exists in the ScaleOut service.|
Use the lock token on the response's LockToken property to perform subsequent operations under the lock.