Class DynamoTable
Implementation for accessing DynamoDB operations in a type-safe mannter using LINQ expressions.
Inheritance
Implements
Namespace: LambdaSharp.DynamoDB.Native
Assembly: LambdaSharp.DynamoDB.Native.dll
Syntax
public class DynamoTable : IDynamoTable
Constructors
DynamoTable(String, IAmazonDynamoDB, DynamoTableOptions)
Create a new Dynamo
Declaration
public DynamoTable(string tableName, IAmazonDynamoDB dynamoClient = null, DynamoTableOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
System. |
tableName | The name of the table. |
Amazon. |
dynamoClient | The |
Dynamo |
options | The table access options. |
Properties
DynamoClient
Get the IAmazonDynamoDB
client.
Declaration
public IAmazonDynamoDB DynamoClient { get; }
Property Value
Type | Description |
---|---|
Amazon. |
Options
Get/set the table access options.
Declaration
public DynamoTableOptions Options { get; set; }
Property Value
Type | Description |
---|---|
Dynamo |
TableName
Get the DynamoDB table name.
Declaration
public string TableName { get; }
Property Value
Type | Description |
---|---|
System. |
Methods
BatchGetItems(Boolean)
Specify the BatchGetItems operation with mixed record types.
Declaration
public IDynamoTableBatchGetItems BatchGetItems(bool consistentRead)
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
public IDynamoTableBatchGetItems<TRecord> BatchGetItems<TRecord>(IEnumerable<DynamoPrimaryKey<TRecord>> primaryKeys, bool consistentRead)
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
public IDynamoTableBatchWriteItems BatchWriteItems()
Returns
Type | Description |
---|---|
IDynamo |
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 |
---|---|---|
Dynamo |
primaryKey | Primary key of the item to delete. |
Returns
Type | Description |
---|---|
IDynamo |
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 |
---|---|---|
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. |
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 |
---|---|---|
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. |
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 |
---|---|---|
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
public IDynamoTableQuery<TRecord> Query<TRecord>(IDynamoQueryClause<TRecord> queryClause, int limit, bool scanIndexForward, bool consistentRead)
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. |
TransactGetItems()
/// Specify the TransactGetItems operation with mixed record types.
Declaration
public 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
public 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
public IDynamoTableTransactWriteItems TransactWriteItems()
Returns
Type | Description |
---|---|
IDynamo |
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 |
---|---|---|
Dynamo |
primaryKey | Primary key of the item to update. |
Returns
Type | Description |
---|---|
IDynamo |
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |