public GetItemAsync ( DynamoDBEntry>.IDictionary |
||
key | DynamoDBEntry>.IDictionary | Key of the document. |
callback | AmazonDynamoDBCallback |
The callback that will be invoked when the asynchronous operation completes. |
asyncOptions | An instance of AsyncOptions that specifies how the async method should be executed. | |
return | void |
public void GetItemAsync(IDictionary<string, DynamoDBEntry> key,
AmazonDynamoDBCallback<Document> callback, AsyncOptions asyncOptions = null)
{
asyncOptions = asyncOptions ?? new AsyncOptions();
DynamoDBAsyncExecutor.ExecuteAsync<Document>(
() => { return GetItemHelper(MakeKey(key), null, true); },
asyncOptions,
callback);
}
Table::GetItemAsync ( DynamoDBEntry>.IDictionary |
|
Table::GetItemAsync ( Primitive hashKey, AmazonDynamoDBCallback |
|
Table::GetItemAsync ( Primitive hashKey, |
|
Table::GetItemAsync ( Primitive hashKey, Primitive rangeKey, AmazonDynamoDBCallback |
|
Table::GetItemAsync ( Primitive hashKey, Primitive rangeKey, |
/// <summary> /// Gets a resource of a given type and with the provided id from a given table /// </summary> /// <param name="table"></param> /// <param name="typeName"></param> /// <param name="id"></param> /// <returns></returns> private async Task <dynamic> Get(DynamoDbTable table, string typeName, string id) { var hashKey = new Primitive($"{typeName}"); var rangeKey = new Primitive(id); Logger.Debug("Getting item with hash key {0} and range key {1} from table {2}...", hashKey, rangeKey, table.TableName); var result = await table.GetItemAsync(hashKey, rangeKey); return(result != null?DynamoDbDocumentHelper.ToObject(result) : null); }