Method PutIfVersionAsync
PutIfVersionAsync(String, MapValue, RowVersion, PutOptions, CancellationToken)
Puts a row into a table if there is an existing row that matches
the primary key and its RowVersion matches the
provided value.
Declaration
public Task<PutResult<RecordValue>> PutIfVersionAsync(string tableName, MapValue row, RowVersion version, PutOptions options = null, CancellationToken cancellationToken = null)
Parameters
| Type | Name | Description |
|---|---|---|
| String | tableName | Name of the table. |
| MapValue | row | Table row. |
| RowVersion | version | Row version to match. |
| PutOptions | options | (Optional) Options for the Put operation. Note that the values of IfAbsent, IfPresent and MatchVersion are not used for this API. |
| CancellationToken | cancellationToken | (Optional) Cancellation token. |
Returns
| Type | Description |
|---|---|
| Task<PutResult<RecordValue>> | Task returning PutResult<TRow>. |
Remarks
This API is a shorthand for PutAsync(String, MapValue, PutOptions, CancellationToken) with
MatchVersion specified.
Exceptions
| Type | Condition |
|---|---|
| ArgumentException | If
tableName is null or invalid or
row is null or invalid or
version is null or invalid or
or options contains invalid values. |
| TimeoutException | Operation has timed out. |
| InvalidOperationException | The table or the service is not in a valid state to perform this operation. |
| NoSQLException | NoSQLException or one of its subclasses is thrown if operation cannot be performed for any other reason. See documentation for corresponding subclass of NoSQLException. |