Пример #1
0
 public async Task InsertAsync(IObservableWallet wallet)
 {
     if (!await _storage.TryInsertAsync(ObservableWalletEntity.Create(wallet)))
     {
         throw new BusinessException($"Wallet {wallet.Address} already exist", ErrorCode.EntityAlreadyExist);
     }
 }
Пример #2
0
 public async Task DeleteAsync(string address)
 {
     if (!await _storage.DeleteIfExistAsync(ObservableWalletEntity.GeneratePartitionKey(address),
                                            ObservableWalletEntity.GenerateRowKey(address)))
     {
         throw new BusinessException($"Wallet {address} not exist", ErrorCode.EntityNotExist);
     }
 }
Пример #3
0
 public async Task <IObservableWallet> GetAsync(string address)
 {
     return(await _storage.GetDataAsync(ObservableWalletEntity.GeneratePartitionKey(address),
                                        ObservableWalletEntity.GenerateRowKey(address)));
 }