Interface IDynamoTablePutItem<TRecord>
Interface to specify a PutItem operation.
Namespace: LambdaSharp.DynamoDB.Native.Operations
Assembly: LambdaSharp.DynamoDB.Native.dll
Syntax
public interface IDynamoTablePutItem<TRecord>
where TRecord : class
Type Parameters
Name | Description |
---|---|
TRecord | The record type. |
Methods
ExecuteAsync(CancellationToken)
Execute the PutItem operation.
Declaration
Task<bool> ExecuteAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Boolean> | True, when successful. False, when condition is not met. |
ExecuteReturnOldItemAsync(CancellationToken)
Execute the PutItem operation.
Declaration
Task<TRecord> ExecuteReturnOldItemAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
System.Threading.CancellationToken | cancellationToken | A cancellation token that can be used by other objects or threads to receive notice of cancellation. |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<TRecord> | Old record when found. |
Set(String, AttributeValue)
Set the value of a DynamoDB item attribute. Used for storing attributes used by local/global secondary indices.
Declaration
IDynamoTablePutItem<TRecord> Set(string key, AttributeValue value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Name of attribute. |
Amazon.DynamoDBv2.Model.AttributeValue | value | Value of attribute. |
Returns
Type | Description |
---|---|
IDynamoTablePutItem<TRecord> |
Set(String, String)
Set the value of a DynamoDB item attribute. Used for storing attributes used by local/global secondary indices.
Declaration
virtual IDynamoTablePutItem<TRecord> Set(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Name of attribute. |
System.String | value | Value of attribute. |
Returns
Type | Description |
---|---|
IDynamoTablePutItem<TRecord> |
WithCondition(Expression<Func<TRecord, Boolean>>)
Add condition for PutItem operation.
Declaration
IDynamoTablePutItem<TRecord> WithCondition(Expression<Func<TRecord, bool>> condition)
Parameters
Type | Name | Description |
---|---|---|
System.Linq.Expressions.Expression<System.Func<TRecord, System.Boolean>> | condition | A lambda predicate representing the DynamoDB condition expression. |
Returns
Type | Description |
---|---|
IDynamoTablePutItem<TRecord> |