Asynchronously creates or updates a serializable object within a named cache.
Namespace: Soss.Client
Assembly: soss_namedcache (in soss_namedcache.dll) Version: 6.2.0.0
Syntax
public Task<AsyncPutResult> PutAsync( CachedObjectId id, Object obj, CreatePolicy createPolicy, PutOptions putOptions, LockTicket lockTicket = null, CancellationToken cancellationToken = null )
Parameters
- id
- Type: Soss.ClientCachedObjectId
Object identifier. - obj
- Type: SystemObject
Serializable object to store in the cache. The argument cannot be null. - createPolicy
- Type: Soss.ClientCreatePolicy
A CreatePolicy instance containing extended cache policy information for the object. In this method, if the optional createPolicy parameter is null and neither ObjectMustExist nor ObjectMustNotExist bits are set for the putOptions parameter, then DefaultCreatePolicy is used instead. When createPolicy parameter is null and the ObjectMustNotExist bit is set for the putOptions parameter is thrown. - putOptions
- Type: PutOptions
PutOptions flags governing various locking and object existence requirements - lockTicket (Optional)
- Type: Soss.ClientLockTicket
An optional LockTicket obtained from a previous locking call - cancellationToken (Optional)
- Type: System.ThreadingCancellationToken
An optional CancellationToken that can be used to cancel the asynchronous operation.
Return Value
Type: TaskAsyncPutResulta Task-wrapped AsyncPutResult which returns an indication as to whether the object was created or updated and any lockTicket resulting from a lock operation.
Exceptions
Exception | Condition |
---|---|
ArgumentNullException | when id or createPolicy is null. |
See Also