示例#1
0
        public IActionResult Update(TransactionUpdateModel transactionUpdateModel)
        {
            try
            {
                var transaction = _transactionDataAccess.UpdateAsync(transactionUpdateModel.TransactionId.ToString(), new Transactions()
                {
                    WalletId        = transactionUpdateModel.WalletId,
                    UserId          = transactionUpdateModel.UserId,
                    Balance         = transactionUpdateModel.Balance,
                    TransactionName = transactionUpdateModel.TransactionName,
                    TransactionTime = transactionUpdateModel.TransactionTime
                }).Result;

                transaction = _transactionDataAccess.GetByIdAsync(transactionUpdateModel.TransactionId.ToString()).Result;

                if (transaction == null)
                {
                    return(BadRequest(new { message = "Transaction güncellenemedi!" }));
                }

                return(Ok(new { transaction }));
            }
            catch (Exception ex)
            {
                return(BadRequest(new { message = ex.Message }));
            }
        }