Show / Hide Table of Contents

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.Boolean consistentRead

Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read).

Returns
Type Description
IDynamoTableBatchGetItems

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.Collections.Generic.IEnumerable<DynamoPrimaryKey<TRecord>> primaryKeys

List of primary keys to retrieve.

System.Boolean consistentRead

Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read).

Returns
Type Description
IDynamoTableBatchGetItems<TRecord>
Type Parameters
Name Description
TRecord

The record type.

BatchWriteItems()

Specify the BatchWriteItems operation to write or delete rows.

Declaration
IDynamoTableBatchWriteItems BatchWriteItems()
Returns
Type Description
IDynamoTableBatchWriteItems

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
DynamoPrimaryKey<TRecord> primaryKey

Primary key of the item to delete.

Returns
Type Description
IDynamoTableDeleteItem<TRecord>
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
DynamoPrimaryKey<TRecord> primaryKey

Primary key of the item to delete.

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.Boolean>
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
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
IDynamoTableGetItem<TRecord>
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
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).

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<TRecord>
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
DynamoPrimaryKey<TRecord> primaryKey

Primary key of the item to write.

TRecord record

The record to write

Returns
Type Description
IDynamoTablePutItem<TRecord>
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
DynamoPrimaryKey<TRecord> primaryKey

Primary key of the item to write.

TRecord record

The record to write

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.Boolean>
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
IDynamoQueryClause queryClause

The query clause that specifies the index and sort-key constraints.

System.Int32 limit

The maximum number of records to read.

System.Boolean scanIndexForward

The direction of index scan.

System.Boolean consistentRead

Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read).

Returns
Type Description
IDynamoTableQuery

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
IDynamoQueryClause<TRecord> queryClause

The query clause that specifies the index and sort-key constraints.

System.Int32 limit

The maximum number of records to read.

System.Boolean scanIndexForward

The direction of index scan.

System.Boolean consistentRead

Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read).

Returns
Type Description
IDynamoTableQuery<TRecord>
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
IDynamoQueryClause<TRecord> queryClause

The query clause that specifies the index and sort-key constraints.

System.Boolean consistentRead

Boolean indicating if the read operations should be performed against the main partition (2x cost compared to eventual consistent read).

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<TRecord>
Type Parameters
Name Description
TRecord

The record type.

TransactGetItems()

Specify the TransactGetItems operation with mixed record types.

Declaration
IDynamoTableTransactGetItems TransactGetItems()
Returns
Type Description
IDynamoTableTransactGetItems

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.Collections.Generic.IEnumerable<DynamoPrimaryKey<TRecord>> primaryKeys

List of primary keys to retrieve.

Returns
Type Description
IDynamoTableTransactGetItems<TRecord>
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
IDynamoTableTransactWriteItems

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
DynamoPrimaryKey<TRecord> primaryKey

Primary key of the item to update.

Returns
Type Description
IDynamoTableUpdateItem<TRecord>
Type Parameters
Name Description
TRecord

The record type.

In This Article
Back to top Generated by DocFX