public async System.Threading.Tasks.Task <IActionResult> Wallet() { var user = await _userManager.GetUserAsync(User); var transactionModel = new TransactionModel { USD = user.USD, //the amount of cash available to spend BTC = user.BTC, //Number of crypto owned ETH = user.ETH, //Number of crypto owned LTC = user.LTC, //Number of crypto owned DOGE = user.DOGE //Number of crypto owned }; WalletModel wallet = _cryptoTransactionService.GetWalletContents(transactionModel); return(View(wallet)); }
public async System.Threading.Tasks.Task <IActionResult> Wallet() { var user = await _userManager.GetUserAsync(User); if (user == null) { throw new ApplicationException($"Unable to load user with ID '{_userManager.GetUserId(User)}'."); } var transactionModel = new TransactionModel { USD = user.USD, BTC = user.BTC, ETH = user.ETH, LTC = user.LTC, DOGE = user.DOGE }; WalletModel wallet = _cryptoTransactionService.GetWalletContents(transactionModel); return(View(wallet)); }