コード例 #1
0
 public async Task ProcessAllAsync(Func <ITransferContract, Task> processAction)
 {
     await _table.GetDataByChunksAsync(TransferContractEntity.GenerateParitionKey(), async (items) =>
     {
         foreach (var item in items)
         {
             await processAction(item);
         }
     });
 }
コード例 #2
0
        public async Task SaveAsync(ITransferContract transferContract)
        {
            var entity = TransferContractEntity.Create(transferContract);

            await _table.InsertOrReplaceAsync(entity);

            if (!string.IsNullOrEmpty(entity.UserAddress))
            {
                var index = new AzureIndex(_indexPartition,
                                           GenerateUserAdapterRowKey(entity.UserAddress, entity.CoinAdapterAddress), entity);

                await _userAdapterIndex.InsertOrReplaceAsync(index);
            }
        }
コード例 #3
0
        public async Task <ITransferContract> GetAsync(string contractAddress)
        {
            ITransferContract result = await _table.GetDataAsync(TransferContractEntity.GenerateParitionKey(), contractAddress);

            return(result);
        }
コード例 #4
0
        public async Task <(IEnumerable <ITransferContract>, string)> GetByTokenAsync(int take, string continuationToken)
        {
            var(collection, token) = await _table.GetDataWithContinuationTokenAsync(TransferContractEntity.GenerateParitionKey(), take, continuationToken);

            return(collection, token);
        }