AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Context interface for using the DataModel mode of DynamoDB. Used to interact with the service, save/load objects, etc.

Inheritance Hierarchy

Amazon.DynamoDBv2.DataModel.IDynamoDBContext

Namespace: Amazon.DynamoDBv2.DataModel
Assembly: AWSSDK.DynamoDBv2.dll
Version: 3.x.y.z

Syntax

C#
public interface IDynamoDBContext
         IDisposable

The IDynamoDBContext type exposes the following members

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method CreateBatchGet(DynamoDBOperationConfig)

Creates a strongly-typed BatchGet object, allowing a batch-get operation against DynamoDB.

Public Method CreateBatchWrite(DynamoDBOperationConfig)

Creates a strongly-typed BatchWrite object, allowing a batch-write operation against DynamoDB.

Public Method CreateBatchWrite(Type, DynamoDBOperationConfig)

Creates a strongly-typed BatchWrite object, allowing a batch-write operation against DynamoDB. This is intended for use only when the valuesType is not known at compile-time, for example, when hooking into EF's ChangeTracker to record audit logs from EF into DynamoDB. In scenarios when the valuesType is known at compile-time, the Amazon.DynamoDBv2.DataModel.IDynamoDBContext.CreateBatchWrite``1(Amazon.DynamoDBv2.DataModel.DynamoDBOperationConfig) method is generally preferred.

Public Method CreateMultiTableBatchGet(BatchGet[])

Creates a MultiTableBatchGet object, composed of multiple individual BatchGet objects.

Public Method CreateMultiTableBatchWrite(BatchWrite[])

Creates a MultiTableBatchWrite object, composed of multiple individual BatchWrite objects.

Public Method CreateMultiTableTransactGet(TransactGet[])

Creates a MultiTableTransactGet object, composed of multiple individual TransactGet objects.

Public Method CreateMultiTableTransactWrite(TransactWrite[])

Creates a MultiTableTransactWrite object, composed of multiple individual TransactWrite objects.

Public Method CreateTransactGet(DynamoDBOperationConfig)

Creates a strongly-typed TransactGet object, allowing a transactional get operation against DynamoDB.

Public Method CreateTransactWrite(DynamoDBOperationConfig)

Creates a strongly-typed TransactWrite object, allowing a transactional write operation against DynamoDB.

Public Method Delete(T)

Deletes an item in DynamoDB corresponding to given object. Passed-in config overrides DynamoDBContextConfig on the context. If SkipVersionCheck=false, will check version of object before deleting. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method Delete(T, DynamoDBOperationConfig)

Deletes an item in DynamoDB corresponding to given object. Passed-in config overrides DynamoDBContextConfig on the context. If SkipVersionCheck=false, will check version of object before deleting. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method Delete(object)

Deletes an item in DynamoDB corresponding to a given hash-and-range primary key. No version check is done prior to delete. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method Delete(object, DynamoDBOperationConfig)

Deletes an item in DynamoDB corresponding to a given hash-and-range primary key. No version check is done prior to delete. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method Delete(object, object)

Deletes an item in DynamoDB corresponding to a given hash-and-range primary key. No version check is done prior to delete. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method Delete(object, object, DynamoDBOperationConfig)

Deletes an item in DynamoDB corresponding to a given hash-and-range primary key. No version check is done prior to delete. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method DeleteAsync(T, CancellationToken)

Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete``1(``0)

Public Method DeleteAsync(T, DynamoDBOperationConfig, CancellationToken)

Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete``1(``0)

Public Method DeleteAsync(object, CancellationToken)

Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete``1(``0)

Public Method DeleteAsync(object, DynamoDBOperationConfig, CancellationToken)

Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete``1(``0)

Public Method DeleteAsync(object, object, CancellationToken)

Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete``1(``0)

Public Method DeleteAsync(object, object, DynamoDBOperationConfig, CancellationToken)

Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete``1(``0)

Public Method ExecuteBatchGet(BatchGet[])

Issues a batch-get request with multiple batches. Results are stored in the individual batches.

Public Method ExecuteBatchGetAsync(BatchGet[], CancellationToken)

Issues a batch-get request with multiple batches. Results are stored in the individual batches.

Public Method ExecuteBatchWrite(BatchWrite[])

Issues a batch-write request with multiple batches.

Public Method ExecuteBatchWriteAsync(BatchWrite[], CancellationToken)

Issues a batch-write request with multiple batches.

Public Method ExecuteTransactGet(TransactGet[])

Issues a transactional get request with multiple TransactGet objects. Results are stored in the individual TransactGet objects.

Public Method ExecuteTransactGetAsync(TransactGet[], CancellationToken)

Issues a transactional get request with multiple TransactGet objects. Results are stored in the individual TransactGet objects.

Public Method ExecuteTransactWrite(TransactWrite[])

Issues a transactional write request with multiple TransactWrite objects.

Public Method ExecuteTransactWriteAsync(TransactWrite[], CancellationToken)

Issues a transactional write request with multiple TransactWrite objects.

Public Method FromDocument(Document)

Deserializes a document to an instance of type T.

Public Method FromDocument(Document, DynamoDBOperationConfig)

Deserializes a document to an instance of type T.

Public Method FromDocuments(IEnumerable<Document>)

Deserializes a collections of documents to a collection of instances of type T.

Public Method FromDocuments(IEnumerable<Document>, DynamoDBOperationConfig)

Deserializes a collections of documents to a collection of instances of type T.

Public Method FromQuery(QueryOperationConfig, DynamoDBOperationConfig)

Executes a Query operation against DynamoDB, finding items that match the specified conditions.

Public Method FromQueryAsync(QueryOperationConfig, DynamoDBOperationConfig)

Configures an async Query operation against DynamoDB, finding items that match the specified conditions.

Public Method FromScan(ScanOperationConfig, DynamoDBOperationConfig)

Executes a Scan operation against DynamoDB, finding items that match the specified conditions.

Public Method FromScanAsync(ScanOperationConfig, DynamoDBOperationConfig)

Configures an async Scan operation against DynamoDB, finding items that match the specified conditions.

Public Method GetTargetTable(DynamoDBOperationConfig)

Retrieves the target table for the specified type

Public Method Load(object)

Loads an object from DynamoDB for the given hash-and-range primary key and using the given config. Passed-in config overrides DynamoDBContextConfig on the context. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method Load(object, DynamoDBOperationConfig)

Loads an object from DynamoDB for the given hash-and-range primary key and using the given config. Passed-in config overrides DynamoDBContextConfig on the context. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method Load(object, object)

Loads an object from DynamoDB for the given hash-and-range primary key and using the given config. Passed-in config overrides DynamoDBContextConfig on the context. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method Load(object, object, DynamoDBOperationConfig)

Loads an object from DynamoDB for the given hash-and-range primary key and using the given config. Passed-in config overrides DynamoDBContextConfig on the context. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method Load(T, DynamoDBOperationConfig)

Loads an object from DynamoDB for the given key and using the given config. The keyObject is a partially-specified instance, where the hash/range properties are equal to the key of the item you want to load. Passed-in config overrides DynamoDBContextConfig on the context. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method LoadAsync(object, CancellationToken)

Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load``1(System.Object)

Public Method LoadAsync(object, DynamoDBOperationConfig, CancellationToken)

Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load``1(System.Object)

Public Method LoadAsync(object, object, CancellationToken)

Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load``1(System.Object)

Public Method LoadAsync(object, object, DynamoDBOperationConfig, CancellationToken)

Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load``1(System.Object)

Public Method LoadAsync(T, CancellationToken)

Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load``1(System.Object)

Public Method LoadAsync(T, DynamoDBOperationConfig, CancellationToken)

Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load``1(System.Object)

Public Method Query(object, DynamoDBOperationConfig)

Executes a Query operation against DynamoDB, finding items that match the specified hash primary key.

Public Method Query(object, QueryOperator, Object[])

Executes a Query operation against DynamoDB, finding items that match the specified range element condition for a hash-and-range primary key.

Public Method Query(object, QueryOperator, IEnumerable<Object>, DynamoDBOperationConfig)

Executes a Query operation against DynamoDB, finding items that match the specified range element condition for a hash-and-range primary key.

Public Method QueryAsync(object, DynamoDBOperationConfig)

Configures an async Query operation against DynamoDB, finding items that match the specified hash primary key.

Public Method QueryAsync(object, QueryOperator, IEnumerable<Object>, DynamoDBOperationConfig)

Configures an async Query operation against DynamoDB, finding items that match the specified range element condition for a hash-and-range primary key.

Public Method RegisterTableDefinition(Table)

Adds a Amazon.DynamoDBv2.DocumentModel.Table to this context's internal cache, which will avoid the need to fetch table metadata automatically from DynamoDB. This may be used in conjunction with an Amazon.DynamoDBv2.DocumentModel.ITableBuilder.

Public Method Save(T, DynamoDBOperationConfig)

Saves an object to DynamoDB using passed-in configs. Passed-in config overrides DynamoDBContextConfig on the context. Type must be marked up with DynamoDBTableAttribute and at least one public field/property with DynamoDBHashKeyAttribute.

Public Method SaveAsync(T, CancellationToken)

Initiates the asynchronous execution of the Save operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Save``1(``0,Amazon.DynamoDBv2.DataModel.DynamoDBOperationConfig)

Public Method SaveAsync(T, DynamoDBOperationConfig, CancellationToken)

Initiates the asynchronous execution of the Save operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Save``1(``0,Amazon.DynamoDBv2.DataModel.DynamoDBOperationConfig)

Public Method SaveAsync(Type, object, CancellationToken)

Initiates the asynchronous execution of the Save operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Save``1(``0,Amazon.DynamoDBv2.DataModel.DynamoDBOperationConfig)

Public Method SaveAsync(Type, object, DynamoDBOperationConfig, CancellationToken)

Initiates the asynchronous execution of the Save operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Save``1(``0,Amazon.DynamoDBv2.DataModel.DynamoDBOperationConfig)

Public Method Scan(ScanCondition[])

Executes a Scan operation against DynamoDB, finding items that match the specified conditions.

Public Method Scan(IEnumerable<ScanCondition>, DynamoDBOperationConfig)

Executes a Scan operation against DynamoDB, finding items that match the specified conditions.

Public Method ScanAsync(IEnumerable<ScanCondition>, DynamoDBOperationConfig)

Configures an async Scan operation against DynamoDB, finding items that match the specified conditions.

Public Method ToDocument(T)

Serializes an object to a Document.

Public Method ToDocument(T, DynamoDBOperationConfig)

Serializes an object to a Document.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5