public override Task <CreateTransactionResult> Create(CreateTransactionRequest request, ServerCallContext context)
        {
            var transaction = transactionsRepository.Create(request.Title, request.Amount, request.Recipient, request.Sender, request.PaymentId, request.CardId);

            return(Task.FromResult(new CreateTransactionResult {
                Transaction = mapper.Map <Transaction>(transaction)
            }));
        }
Пример #2
0
        public override Task <CreateTransactionResult> Create(CreateTransactionRequest request, ServerCallContext context)
        {
            var transaction = transactionsRepository.Create(request.Title, request.Amount, request.Recipient, request.Sender, request.PaymentId, request.CardId);

            projectionChannel.Publish(context.RequestHeaders.GetFlowId(), new DataProjection <Models.Transaction, string> {
                Upsert = new[] { transaction }
            });
            return(Task.FromResult(new CreateTransactionResult {
                Transaction = mapper.Map <Transaction>(transaction)
            }));
        }
Пример #3
0
        public Task Create(MessageContext context, CreateTransactionEvent inputEvent)
        {
            var transaction = transactionsRepository.Create(inputEvent.Title, inputEvent.Amount, inputEvent.Recipient, inputEvent.Sender, inputEvent.PaymentId, inputEvent.CardId);

            if (context.ReplyTo != null)
            {
                publishingRouter.Publish(context.ReplyTo, new SelectedTransactionsEvent {
                    Transactions = new[] { transaction }
                }, context.FlowId);
            }
            return(Task.CompletedTask);
        }
Пример #4
0
 public async Task AddNewTransaction(Transaction transaction)
 {
     await _transactionsRepository.Create(transaction);
 }
Пример #5
0
 internal Transaction Create(Transaction newTransaction)
 {
     return(_repo.Create(newTransaction));
 }