Interface IDynamoTableTransactGetItems
Interface to specify the TransactGetItems operation with mixed record types.
Namespace: LambdaSharp.DynamoDB.Native.Operations
Assembly: LambdaSharp.DynamoDB.Native.dll
Syntax
public interface IDynamoTableTransactGetItems
Methods
BeginGetItem<TRecord>(DynamoPrimaryKey<TRecord>, Boolean)
Begin specification of a GetItem operation for TransactGetItems.
Declaration
IDynamoTableTransactGetItemsBegin<TRecord> BeginGetItem<TRecord>(DynamoPrimaryKey<TRecord> primaryKey, bool consistentRead = false)
where TRecord : class
Parameters
| Type | Name | Description |
|---|---|---|
| DynamoPrimaryKey<TRecord> | primaryKey | Primary key of the item to retrieve. |
| System.Boolean | consistentRead | Boolean indicating if the read operation should be performed against the main partition (2x cost compared to eventual consistent read). |
Returns
| Type | Description |
|---|---|
| IDynamoTableTransactGetItemsBegin<TRecord> |
Type Parameters
| Name | Description |
|---|---|
| TRecord | The record type. |
GetItem<TRecord>(DynamoPrimaryKey<TRecord>, Boolean)
Add a GetItem operation to TransactGetItems that retrieves all attributes for the given primary key.
This method is the same: BeginGetItem(primaryKey, consistentRead).End().
Declaration
virtual IDynamoTableTransactGetItems GetItem<TRecord>(DynamoPrimaryKey<TRecord> primaryKey, bool consistentRead = false)
where TRecord : class
Parameters
| Type | Name | Description |
|---|---|---|
| DynamoPrimaryKey<TRecord> | primaryKey | Primary key of the item to retrieve. |
| System.Boolean | consistentRead | Boolean indicating if the read operation should be performed against the main partition (2x cost compared to eventual consistent read). |
Returns
| Type | Description |
|---|---|
| IDynamoTableTransactGetItems |
Type Parameters
| Name | Description |
|---|---|
| TRecord | The record type. |
TryExecuteAsync(Int32, CancellationToken)
Attempts the TransactGetItems operation.
Declaration
Task<(bool Success, IEnumerable<object> Items)> TryExecuteAsync(int maxAttempts = 5, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Int32 | maxAttempts | Maximum number of attempts with exponential back when encountering provisioned throughput is exceeded. |
| System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<System.ValueTuple<System.Boolean, System.Collections.Generic.IEnumerable<System.Object>>> | A tuple indicating the success of the transatcion and the list of found items when successful. |