Beispiel #1
0
 private void SendDoTransactionMessage(Models.Transaction transaction)
 {
     Messages.Commands.CreateTransaction doTransaction = new Messages.Commands.CreateTransaction()
     {
         FromAccountId = transaction.FromAccountId,
         ToAccountId   = transaction.ToAccountId,
         Amount        = transaction.Amount,
         TransactionId = transaction.Id
     };
     _messageSession.Send(doTransaction).ConfigureAwait(false);
 }
Beispiel #2
0
        public async Task <bool> DoTransactionAsync(Models.Transaction transaction)
        {
            //change it to the repo
            transaction.Id     = Guid.NewGuid();
            transaction.Status = Models.eStatus.processing;
            transaction.Date   = DateTime.Now;
            await AddTransactionToDB(transaction);

            SendDoTransactionMessage(transaction);
            return(true);
        }
Beispiel #3
0
 private async Task <bool> AddTransactionToDB(Models.Transaction transaction)
 {
     return(await _transactionRepository.AddTransactionToDB(transaction));
 }