Exemplo n.º 1
0
        public async Task <ActionResult> Post([FromBody] WalletModelPost value)
        {
            try
            {
                bool result = await _usersWalletsService.IsUserWallet(value);

                if (result)
                {
                    await _usersWalletsService.TransferCrypto(value);
                }
                return(Ok(value));
            }
            catch (AppException ex)
            {
                return(BadRequest(ex.Message));
            }
        }
 public async Task <bool> TransferCrypto(WalletModelPost value)
 {
     return(await _repositoryUserWallets.TransferCrypto(value.Sent, value.Id, value.Amount));
 }
 public Task <bool> IsUserWallet(WalletModelPost value)
 {
     return(_repositoryUserWallets.IsUserWallet(value.Id, value.UserId));
 }