Interface IDynamoTable
Interface exposing DynamoDB operations in a type-safe mannter using LINQ expressions.
Namespace: LambdaSharp.DynamoDB.Native
Assembly: LambdaSharp.DynamoDB.Native.dll
Syntax
public interface IDynamoTable
Methods
BatchGetItems(Boolean)
Specify the BatchGetItems operation with mixed record types.
Declaration
IDynamoTableBatchGetItems BatchGetItems(bool consistentRead = false)
Parameters
Type | Name | Description |
---|---|---|
System. |
consistentRead | Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read). |
Returns
Type | Description |
---|---|
IDynamo |
BatchGetItems<TRecord>(IEnumerable<DynamoPrimaryKey<TRecord>>, Boolean)
Specify the BatchGetItems operation for a list of primary keys that all share the same record type.
Declaration
IDynamoTableBatchGetItems<TRecord> BatchGetItems<TRecord>(IEnumerable<DynamoPrimaryKey<TRecord>> primaryKeys, bool consistentRead = false)
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
System. |
primaryKeys | List of primary keys to retrieve. |
System. |
consistentRead | Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read). |
Returns
Type | Description |
---|---|
IDynamo |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
BatchWriteItems()
Specify the BatchWriteItems operation to write or delete rows.
Declaration
IDynamoTableBatchWriteItems BatchWriteItems()
Returns
Type | Description |
---|---|
IDynamo |
DeleteItem<TRecord>(DynamoPrimaryKey<TRecord>)
Specify the DeleteItem operation for the given primary key.
Declaration
IDynamoTableDeleteItem<TRecord> DeleteItem<TRecord>(DynamoPrimaryKey<TRecord> primaryKey)
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
Dynamo |
primaryKey | Primary key of the item to delete. |
Returns
Type | Description |
---|---|
IDynamo |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
DeleteItemAsync<TRecord>(DynamoPrimaryKey<TRecord>, CancellationToken)
Performs a DeleteItem operation to delete the given primary key.
This method is the same: DeleteItem(primaryKey).ExecuteAsync(cancellationToken)
.
Declaration
virtual Task<bool> DeleteItemAsync<TRecord>(DynamoPrimaryKey<TRecord> primaryKey, CancellationToken cancellationToken = default(CancellationToken))
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
Dynamo |
primaryKey | Primary key of the item to delete. |
System. |
cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
System. |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
GetItem<TRecord>(DynamoPrimaryKey<TRecord>, Boolean)
Specify the GetItem operation for the given primary key.
Declaration
IDynamoTableGetItem<TRecord> GetItem<TRecord>(DynamoPrimaryKey<TRecord> primaryKey, bool consistentRead = false)
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
Dynamo |
primaryKey | Primary key of the item to retrieve. |
System. |
consistentRead | Boolean indicating if the read operation should be performed against the main partition (2x cost compared to eventual consistent read). |
Returns
Type | Description |
---|---|
IDynamo |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
GetItemAsync<TRecord>(DynamoPrimaryKey<TRecord>, Boolean, CancellationToken)
Perform a GetItem operation that retrieves all attributes for the given primary key.
This method is the same: GetItem(primaryKey, consistentRead).ExecuteAsync(cancellationToken)
.
Declaration
virtual Task<TRecord> GetItemAsync<TRecord>(DynamoPrimaryKey<TRecord> primaryKey, bool consistentRead = false, CancellationToken cancellationToken = default(CancellationToken))
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
Dynamo |
primaryKey | Primary key of the item to retrieve. |
System. |
consistentRead | Boolean indicating if the read operation should be performed against the main partition (2x cost compared to eventual consistent read). |
System. |
cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
System. |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
PutItem<TRecord>(DynamoPrimaryKey<TRecord>, TRecord)
Specify the PutItem operation for the given primary key and record. When successful, this operation creates a new row or replaces all attributes of the matching row.
Declaration
IDynamoTablePutItem<TRecord> PutItem<TRecord>(DynamoPrimaryKey<TRecord> primaryKey, TRecord record)
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
Dynamo |
primaryKey | Primary key of the item to write. |
TRecord | record | The record to write |
Returns
Type | Description |
---|---|
IDynamo |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
PutItemAsync<TRecord>(DynamoPrimaryKey<TRecord>, TRecord, CancellationToken)
Performs a PutItem operation that creates/replaces the row matched by the given primary key with the given record.
This method is the same: PuItem(primaryKey, record).ExecuteAsync(cancellationToken)
.
Declaration
virtual Task<bool> PutItemAsync<TRecord>(DynamoPrimaryKey<TRecord> primaryKey, TRecord record, CancellationToken cancellationToken = default(CancellationToken))
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
Dynamo |
primaryKey | Primary key of the item to write. |
TRecord | record | The record to write |
System. |
cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
System. |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
Query(IDynamoQueryClause, Int32, Boolean, Boolean)
Specify the Query operation to fetch a list of mixed records type.
Declaration
IDynamoTableQuery Query(IDynamoQueryClause queryClause, int limit = 2147483647, bool scanIndexForward = true, bool consistentRead = false)
Parameters
Type | Name | Description |
---|---|---|
IDynamo |
queryClause | The query clause that specifies the index and sort-key constraints. |
System. |
limit | The maximum number of records to read. |
System. |
scanIndexForward | The direction of index scan. |
System. |
consistentRead | Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read). |
Returns
Type | Description |
---|---|
IDynamo |
Query<TRecord>(IDynamoQueryClause<TRecord>, Int32, Boolean, Boolean)
Specify the Query operation to fetch a list of records of the same type.
Declaration
IDynamoTableQuery<TRecord> Query<TRecord>(IDynamoQueryClause<TRecord> queryClause, int limit = 2147483647, bool scanIndexForward = true, bool consistentRead = false)
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
IDynamo |
queryClause | The query clause that specifies the index and sort-key constraints. |
System. |
limit | The maximum number of records to read. |
System. |
scanIndexForward | The direction of index scan. |
System. |
consistentRead | Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read). |
Returns
Type | Description |
---|---|
IDynamo |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
QuerySingleAsync<TRecord>(IDynamoQueryClause<TRecord>, Boolean, CancellationToken)
Performs a Query operation to retrieve a single.
This method is the same: Query(queryClause, limit: 1, consistentRead).ExecuteFetchAllAttributesAsync(cancellationToken)
.
Declaration
virtual async Task<TRecord> QuerySingleAsync<TRecord>(IDynamoQueryClause<TRecord> queryClause, bool consistentRead = false, CancellationToken cancellationToken = default(CancellationToken))
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
IDynamo |
queryClause | The query clause that specifies the index and sort-key constraints. |
System. |
consistentRead | Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read). |
System. |
cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
System. |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
TransactGetItems()
Specify the TransactGetItems operation with mixed record types.
Declaration
IDynamoTableTransactGetItems TransactGetItems()
Returns
Type | Description |
---|---|
IDynamo |
TransactGetItems<TRecord>(IEnumerable<DynamoPrimaryKey<TRecord>>)
Specify the TransactGetItems operation for a list of primary keys that all share the same record type.
Declaration
IDynamoTableTransactGetItems<TRecord> TransactGetItems<TRecord>(IEnumerable<DynamoPrimaryKey<TRecord>> primaryKeys)
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
System. |
primaryKeys | List of primary keys to retrieve. |
Returns
Type | Description |
---|---|
IDynamo |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
TransactWriteItems()
Specify the TransactWriteItems to created, put, update, or delete records in a transaction.
Declaration
IDynamoTableTransactWriteItems TransactWriteItems()
Returns
Type | Description |
---|---|
IDynamo |
UpdateItem<TRecord>(DynamoPrimaryKey<TRecord>)
Specify the UpdateItem operation for the given primary key.
Declaration
IDynamoTableUpdateItem<TRecord> UpdateItem<TRecord>(DynamoPrimaryKey<TRecord> primaryKey)
where TRecord : class
Parameters
Type | Name | Description |
---|---|---|
Dynamo |
primaryKey | Primary key of the item to update. |
Returns
Type | Description |
---|---|
IDynamo |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |