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 object for using the DataModel mode of DynamoDB. Used to interact with the service, save/load objects, etc.

Inheritance Hierarchy

System.Object
  Amazon.DynamoDBv2.DataModel.DynamoDBContext

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

Syntax

C#
public class DynamoDBContext
         IDisposable, IDynamoDBContext

The DynamoDBContext type exposes the following members

Constructors

NameDescription
Public Method DynamoDBContext()

Constructs a DynamoDBContext object with a default AmazonDynamoDBClient client and a default DynamoDBContextConfig object for configuration.

Public Method DynamoDBContext(RegionEndpoint)

Constructs a DynamoDBContext object with a default AmazonDynamoDBClient client and a default DynamoDBContextConfig object for configuration.

Public Method DynamoDBContext(DynamoDBContextConfig)

Constructs a DynamoDBContext object with the specified configuration. Uses a default AmazonDynamoDBClient as the client.

Public Method DynamoDBContext(RegionEndpoint, DynamoDBContextConfig)

Constructs a DynamoDBContext object with the specified configuration. Uses a default AmazonDynamoDBClient as the client.

Public Method DynamoDBContext(IAmazonDynamoDB)

Constructs a DynamoDBContext object with the specified DynamoDB client. Uses default DynamoDBContextConfig object for configuration.

Public Method DynamoDBContext(IAmazonDynamoDB, DynamoDBContextConfig)

Constructs a DynamoDBContext object with the specified DynamoDB client and configuration.

Properties

NameTypeDescription
Public Property ConverterCache System.Collections.Generic.Dictionary<System.Type, Amazon.DynamoDBv2.DataModel.IPropertyConverter>

This cache is a way to store Converters for objects which provides a way to expand Context

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()

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

Public Method CreateBatchGet(DynamoDBOperationConfig)

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

Public Method CreateBatchWrite()

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

Public Method CreateBatchWrite(DynamoDBOperationConfig)

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

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 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 Dispose()

Disposes of all managed and unmanaged resources.

Public Method ExecuteBatchGet(BatchGet[])

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

Public Method ExecuteBatchGetAsync(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 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)

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

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, 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 Query(object)

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

Public Method Query(object, DynamoDBOperationConfig)

Executes a Query operation against DynamoDB, finding items that match the specified hash 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 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 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 Standard:
Supported in: 1.3

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

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms

Unity:
Supported Versions: 4.6 and above
Supported Platforms: Android, iOS, Standalone