public async Task <ActionResult <Transaction> > UpdateAmount(int id, double amount, string transtype) { var user = await _userServices.GetUser(id); if (user == null) { return(NotFound()); } Transactions transaction = new Transactions { ID = id, Amount = amount, TransactionType = transtype, Date = DateTime.Now }; await _transaction.AddTransactions(transaction); user.Balance = _transaction.UpdateAmount(amount, user.Balance, transtype); _userContext.SaveChanges(); return(NoContent()); }