コード例 #1
0
        public async Task <IHistoryOperation> GetAsync(string id)
        {
            AzureIndex index =
                await _indexById.GetDataAsync(IndexById.GeneratePartitionKey(id), IndexById.GenerateRowKey());

            return(await _storage.GetDataAsync(index));
        }
コード例 #2
0
        public async Task SetTxHashAsync(string id, string txHash)
        {
            AzureIndex index =
                await _indexById.GetDataAsync(IndexById.GeneratePartitionKey(id), IndexById.GenerateRowKey());

            if (index == null)
            {
                throw new HistoryOperationNotFoundException(id);
            }

            HistoryOperationEntity updated = await _storage.MergeAsync(
                index.PrimaryPartitionKey, index.PrimaryRowKey,
                o =>
            {
                o.TxHash = txHash;
                return(o);
            });

            if (updated == null)
            {
                throw new HistoryOperationNotFoundException(id);
            }
        }