Interface IDynamoDBContext
- Namespace
- Amazon.DynamoDBv2.DataModel
- Assembly
- AWSSDK.DynamoDBv2.dll
Context interface for using the DataModel mode of DynamoDB. Used to interact with the service, save/load objects, etc.
public interface IDynamoDBContext : IDisposable
- Inherited Members
Methods
CreateBatchGet<T>(DynamoDBOperationConfig)
Creates a strongly-typed BatchGet object, allowing a batch-get operation against DynamoDB.
BatchGet<T> CreateBatchGet<T>(DynamoDBOperationConfig operationConfig = null)
Parameters
operationConfigDynamoDBOperationConfigConfig object which can be used to override that table used.
Returns
- BatchGet<T>
Empty strongly-typed BatchGet object
Type Parameters
TType of objects to get
CreateBatchWrite<T>(DynamoDBOperationConfig)
Creates a strongly-typed BatchWrite object, allowing a batch-write operation against DynamoDB.
BatchWrite<T> CreateBatchWrite<T>(DynamoDBOperationConfig operationConfig = null)
Parameters
operationConfigDynamoDBOperationConfigConfig object which can be used to override that table used.
Returns
- BatchWrite<T>
Empty strongly-typed BatchWrite object
Type Parameters
TType of objects to write
CreateMultiTableBatchGet(params BatchGet[])
Creates a MultiTableBatchGet object, composed of multiple individual BatchGet objects.
MultiTableBatchGet CreateMultiTableBatchGet(params BatchGet[] batches)
Parameters
batchesBatchGet[]Individual BatchGet objects
Returns
- MultiTableBatchGet
Composite MultiTableBatchGet object
CreateMultiTableBatchWrite(params BatchWrite[])
Creates a MultiTableBatchWrite object, composed of multiple individual BatchWrite objects.
MultiTableBatchWrite CreateMultiTableBatchWrite(params BatchWrite[] batches)
Parameters
batchesBatchWrite[]Individual BatchWrite objects
Returns
- MultiTableBatchWrite
Composite MultiTableBatchWrite object
DeleteAsync<T>(object, DynamoDBOperationConfig, CancellationToken)
Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete
Task DeleteAsync<T>(object hashKey, DynamoDBOperationConfig operationConfig, CancellationToken cancellationToken = default)
Parameters
hashKeyobjectHash key element of the object to delete.
operationConfigDynamoDBOperationConfigConfig object which can be used to override that table used.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType of object.
DeleteAsync<T>(object, object, DynamoDBOperationConfig, CancellationToken)
Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete
Task DeleteAsync<T>(object hashKey, object rangeKey, DynamoDBOperationConfig operationConfig, CancellationToken cancellationToken = default)
Parameters
hashKeyobjectHash key element of the object to delete.
rangeKeyobjectRange key element of the object to delete.
operationConfigDynamoDBOperationConfigConfig object which can be used to override that table used.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType of object.
DeleteAsync<T>(object, object, CancellationToken)
Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete
Task DeleteAsync<T>(object hashKey, object rangeKey, CancellationToken cancellationToken = default)
Parameters
hashKeyobjectHash key element of the object to delete.
rangeKeyobjectRange key element of the object to delete.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType of object.
DeleteAsync<T>(object, CancellationToken)
Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete
Task DeleteAsync<T>(object hashKey, CancellationToken cancellationToken = default)
Parameters
hashKeyobjectHash key element of the object to delete.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType of object.
DeleteAsync<T>(T, DynamoDBOperationConfig, CancellationToken)
Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete
Task DeleteAsync<T>(T value, DynamoDBOperationConfig operationConfig, CancellationToken cancellationToken = default)
Parameters
valueTObject to delete.
operationConfigDynamoDBOperationConfigOverriding configuration.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType of object.
DeleteAsync<T>(T, CancellationToken)
Initiates the asynchronous execution of the Delete operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Delete
Task DeleteAsync<T>(T value, CancellationToken cancellationToken = default)
Parameters
valueTObject to delete.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType of object.
ExecuteBatchGetAsync(BatchGet[], CancellationToken)
Issues a batch-get request with multiple batches.
Results are stored in the individual batches.
Task ExecuteBatchGetAsync(BatchGet[] batches, CancellationToken cancellationToken = default)
Parameters
batchesBatchGet[]Configured BatchGet objects
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
ExecuteBatchWriteAsync(BatchWrite[], CancellationToken)
Issues a batch-write request with multiple batches.
Task ExecuteBatchWriteAsync(BatchWrite[] batches, CancellationToken cancellationToken = default)
Parameters
batchesBatchWrite[]Configured BatchWrite objects
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
FromDocument<T>(Document)
Deserializes a document to an instance of type T.
T FromDocument<T>(Document document)
Parameters
documentDocumentDocument with properties to use.
Returns
- T
Object of type T, populated with properties from the document.
Type Parameters
TType to populate.
FromDocument<T>(Document, DynamoDBOperationConfig)
Deserializes a document to an instance of type T.
T FromDocument<T>(Document document, DynamoDBOperationConfig operationConfig)
Parameters
documentDocumentDocument with properties to use.
operationConfigDynamoDBOperationConfigConfig object which can be used to override the table used.
Returns
- T
Object of type T, populated with properties from the document.
Type Parameters
TType to populate.
FromDocuments<T>(IEnumerable<Document>)
Deserializes a collections of documents to a collection of instances of type T.
IEnumerable<T> FromDocuments<T>(IEnumerable<Document> documents)
Parameters
documentsIEnumerable<Document>Documents to deserialize.
Returns
- IEnumerable<T>
Collection of items of type T, each populated with properties from a corresponding document.
Type Parameters
TType to populate.
FromDocuments<T>(IEnumerable<Document>, DynamoDBOperationConfig)
Deserializes a collections of documents to a collection of instances of type T.
IEnumerable<T> FromDocuments<T>(IEnumerable<Document> documents, DynamoDBOperationConfig operationConfig)
Parameters
documentsIEnumerable<Document>Documents to deserialize.
operationConfigDynamoDBOperationConfigConfig object which can be used to override the table used.
Returns
- IEnumerable<T>
Collection of items of type T, each populated with properties from a corresponding document.
Type Parameters
TType to populate.
FromQueryAsync<T>(QueryOperationConfig, DynamoDBOperationConfig)
Configures an async Query operation against DynamoDB, finding items that match the specified conditions.
AsyncSearch<T> FromQueryAsync<T>(QueryOperationConfig queryConfig, DynamoDBOperationConfig operationConfig = null)
Parameters
queryConfigQueryOperationConfigQuery request object.
operationConfigDynamoDBOperationConfigConfig object which can be used to override the table used.
Returns
- AsyncSearch<T>
AsyncSearch which can be used to retrieve DynamoDB data.
Type Parameters
TType of object.
FromScanAsync<T>(ScanOperationConfig, DynamoDBOperationConfig)
Configures an async Scan operation against DynamoDB, finding items that match the specified conditions.
AsyncSearch<T> FromScanAsync<T>(ScanOperationConfig scanConfig, DynamoDBOperationConfig operationConfig = null)
Parameters
scanConfigScanOperationConfigScan request object.
operationConfigDynamoDBOperationConfigConfig object which can be used to override the table used.
Returns
- AsyncSearch<T>
AsyncSearch which can be used to retrieve DynamoDB data.
Type Parameters
TType of object.
GetTargetTable<T>(DynamoDBOperationConfig)
Retrieves the target table for the specified type
Table GetTargetTable<T>(DynamoDBOperationConfig operationConfig = null)
Parameters
operationConfigDynamoDBOperationConfig
Returns
- Table
Table object
Type Parameters
TType to retrieve table for
LoadAsync<T>(object, DynamoDBOperationConfig, CancellationToken)
Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load
Task<T> LoadAsync<T>(object hashKey, DynamoDBOperationConfig operationConfig, CancellationToken cancellationToken = default)
Parameters
hashKeyobjectHash key element of the target item.
operationConfigDynamoDBOperationConfigOverriding configuration.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task<T>
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType to populate.
LoadAsync<T>(object, object, DynamoDBOperationConfig, CancellationToken)
Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load
Task<T> LoadAsync<T>(object hashKey, object rangeKey, DynamoDBOperationConfig operationConfig, CancellationToken cancellationToken = default)
Parameters
hashKeyobjectHash key element of the target item.
rangeKeyobjectRange key element of the target item.
operationConfigDynamoDBOperationConfigOverriding configuration.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task<T>
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType to populate.
LoadAsync<T>(object, object, CancellationToken)
Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load
Task<T> LoadAsync<T>(object hashKey, object rangeKey, CancellationToken cancellationToken = default)
Parameters
hashKeyobjectHash key element of the target item.
rangeKeyobjectRange key element of the target item.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task<T>
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType to populate.
LoadAsync<T>(object, CancellationToken)
Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load
Task<T> LoadAsync<T>(object hashKey, CancellationToken cancellationToken = default)
Parameters
hashKeyobjectHash key element of the target item.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task<T>
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType to populate.
LoadAsync<T>(T, DynamoDBOperationConfig, CancellationToken)
Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load
Task<T> LoadAsync<T>(T keyObject, DynamoDBOperationConfig operationConfig, CancellationToken cancellationToken = default)
Parameters
keyObjectTKey of the target item.
operationConfigDynamoDBOperationConfigOverriding configuration.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task<T>
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType to populate.
LoadAsync<T>(T, CancellationToken)
Initiates the asynchronous execution of the Load operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Load
Task<T> LoadAsync<T>(T keyObject, CancellationToken cancellationToken = default)
Parameters
keyObjectTKey of the target item.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task<T>
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType to populate.
QueryAsync<T>(object, DynamoDBOperationConfig)
Configures an async Query operation against DynamoDB, finding items that match the specified hash primary key.
AsyncSearch<T> QueryAsync<T>(object hashKeyValue, DynamoDBOperationConfig operationConfig = null)
Parameters
hashKeyValueobjectHash key of the items to query.
operationConfigDynamoDBOperationConfigConfig object which can be used to override the table used.
Returns
- AsyncSearch<T>
AsyncSearch which can be used to retrieve DynamoDB data.
Type Parameters
TType of object.
QueryAsync<T>(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.
AsyncSearch<T> QueryAsync<T>(object hashKeyValue, QueryOperator op, IEnumerable<object> values, DynamoDBOperationConfig operationConfig = null)
Parameters
hashKeyValueobjectHash key of the items to query.
opQueryOperatorOperation of the condition.
valuesIEnumerable<object>Value(s) of the condition. For all operations except QueryOperator.Between, values should be one value. For QueryOperator.Betwee, values should be two values.
operationConfigDynamoDBOperationConfigConfig object which can be used to override the table used.
Returns
- AsyncSearch<T>
AsyncSearch which can be used to retrieve DynamoDB data.
Type Parameters
TType of object.
SaveAsync<T>(T, DynamoDBOperationConfig, CancellationToken)
Initiates the asynchronous execution of the Save operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Save
Task SaveAsync<T>(T value, DynamoDBOperationConfig operationConfig, CancellationToken cancellationToken = default)
Parameters
valueTObject to save.
operationConfigDynamoDBOperationConfigOverriding configuration.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType to save as.
SaveAsync<T>(T, CancellationToken)
Initiates the asynchronous execution of the Save operation. Amazon.DynamoDBv2.DataModel.DynamoDBContext.Save
Task SaveAsync<T>(T value, CancellationToken cancellationToken = default)
Parameters
valueTObject to save.
cancellationTokenCancellationTokenToken which can be used to cancel the task.
Returns
- Task
A Task that can be used to poll or wait for results, or both.
Type Parameters
TType to save as.
ScanAsync<T>(IEnumerable<ScanCondition>, DynamoDBOperationConfig)
Configures an async Scan operation against DynamoDB, finding items that match the specified conditions.
AsyncSearch<T> ScanAsync<T>(IEnumerable<ScanCondition> conditions, DynamoDBOperationConfig operationConfig = null)
Parameters
conditionsIEnumerable<ScanCondition>Conditions that the results should meet.
operationConfigDynamoDBOperationConfigConfig object which can be used to override that table used.
Returns
- AsyncSearch<T>
AsyncSearch which can be used to retrieve DynamoDB data.
Type Parameters
TType of object.
ToDocument<T>(T)
Serializes an object to a Document.
Document ToDocument<T>(T value)
Parameters
valueTObject to serialize.
Returns
- Document
Document with attributes populated from object.
Type Parameters
TType to serialize as.
ToDocument<T>(T, DynamoDBOperationConfig)
Serializes an object to a Document.
Document ToDocument<T>(T value, DynamoDBOperationConfig operationConfig)
Parameters
valueTObject to serialize.
operationConfigDynamoDBOperationConfigConfig object which can be used to override the table used.
Returns
- Document
Document with attributes populated from object.
Type Parameters
TType to serialize as.