Show / Hide Table of Contents

Class DynamoTable

Implementation for accessing DynamoDB operations in a type-safe mannter using LINQ expressions.

Inheritance
System.Object
DynamoTable
Implements
IDynamoTable
Namespace: LambdaSharp.DynamoDB.Native
Assembly: LambdaSharp.DynamoDB.Native.dll
Syntax
public class DynamoTable : IDynamoTable

Constructors

DynamoTable(String, IAmazonDynamoDB, DynamoTableOptions)

Create a new DynamoTable instance.

Declaration
public DynamoTable(string tableName, IAmazonDynamoDB dynamoClient = null, DynamoTableOptions options = null)
Parameters
Type Name Description
System.String tableName

The name of the table.

Amazon.DynamoDBv2.IAmazonDynamoDB dynamoClient

The IAmazonDynamoDB client to use.

DynamoTableOptions options

The table access options.

Properties

DynamoClient

Get the IAmazonDynamoDB client.

Declaration
public IAmazonDynamoDB DynamoClient { get; }
Property Value
Type Description
Amazon.DynamoDBv2.IAmazonDynamoDB

Options

Get/set the table access options.

Declaration
public DynamoTableOptions Options { get; set; }
Property Value
Type Description
DynamoTableOptions

TableName

Get the DynamoDB table name.

Declaration
public string TableName { get; }
Property Value
Type Description
System.String

Methods

BatchGetItems(Boolean)

Specify the BatchGetItems operation with mixed record types.

Declaration
public IDynamoTableBatchGetItems BatchGetItems(bool consistentRead)
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
public IDynamoTableBatchGetItems<TRecord> BatchGetItems<TRecord>(IEnumerable<DynamoPrimaryKey<TRecord>> primaryKeys, bool consistentRead)
    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
public IDynamoTableBatchWriteItems BatchWriteItems()
Returns
Type Description
IDynamoTableBatchWriteItems

DeleteItem<TRecord>(DynamoPrimaryKey<TRecord>)

/// Specify the DeleteItem operation for the given primary key.

Declaration
public 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.

GetItem<TRecord>(DynamoPrimaryKey<TRecord>, Boolean)

Specify the GetItem operation for the given primary key.

Declaration
public 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.

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
public 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.

Query(IDynamoQueryClause, Int32, Boolean, Boolean)

Specify the Query operation to fetch a list of mixed records type.

Declaration
public IDynamoTableQuery Query(IDynamoQueryClause queryClause, int limit, bool scanIndexForward, bool consistentRead)
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
public IDynamoTableQuery<TRecord> Query<TRecord>(IDynamoQueryClause<TRecord> queryClause, int limit, bool scanIndexForward, bool consistentRead)
    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.

TransactGetItems()

/// Specify the TransactGetItems operation with mixed record types.

Declaration
public 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
public 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
public IDynamoTableTransactWriteItems TransactWriteItems()
Returns
Type Description
IDynamoTableTransactWriteItems

UpdateItem<TRecord>(DynamoPrimaryKey<TRecord>)

Specify the UpdateItem operation for the given primary key.

Declaration
public 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.

Implements

IDynamoTable
In This Article
Back to top Generated by DocFX