コード例 #1
0
        public Task InsertOrReplaceAsync(IWalletBalance balance)
        {
            return(_storage.InsertOrReplaceAsync(WalletBalanceEntity.Create(balance),
                                                 existed =>
            {
                var needToUpdate = existed.UpdatedAtBlockHeight < balance.UpdatedAtBlockHeight;

                if (needToUpdate)
                {
                    _log.Info("Updating wallet balance in db", context: balance);
                }

                return existed.UpdatedAtBlockHeight < balance.UpdatedAtBlockHeight;
            }));
        }
コード例 #2
0
 public Task DeleteIfExistAsync(string address, string assetId)
 {
     return(_storage.DeleteIfExistAsync(WalletBalanceEntity.GeneratePartitionKey(address),
                                        WalletBalanceEntity.GenerateRowKey(address, assetId)));
 }