Constructor RowVersion
RowVersion(Byte[])
Initializes new instance of RowVersion with the
specified
byte[]
value.
Declaration
public RowVersion(byte[] value)
Parameters
Type | Name | Description |
---|---|---|
Byte[] | value | The value of the contents of this version. |
Remarks
This constructor can be used to create row version from a
byte[]
that was obtained from a query using
row_version
SQL function, as shown in the example.
Examples
Obtaining row version from a query and using it in PutIfVersionAsync(String, MapValue, RowVersion, PutOptions, CancellationToken).var queryResult = await client.QueryAsync(
"SELECT row_version($t) AS version FROM MyTable $t WHERE id = 1");
if (queryResult.Rows.Count != 0)
{
var rowVersion = new RowVersion(queryResult.Rows[0]["version"]);
var newRow = new MapValue
{
["id"] = 1,
["name"] = "Jane"
};
var putResult = await client.PutIfVersionAsync("MyTable",
newRow, rowVersion);
}
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If
value is null . |