public Task Setup(TransactionsSetup setup) { for (int i = 0; i < setup.transactions.Length; i += 10000) { var portion = setup.transactions.Skip(i).Take(10000).ToArray(); var transactionsEvent = new SetupAppendTransactionsEvent { Transactions = portion.Select(t => mapper.Map <Transaction>(t)).ToArray() }; this.publishingRouter.Publish(Queues.Transactions, transactionsEvent, null); } return(Task.CompletedTask); }
public Task Setup(SetupAll setup) { var usersEvent = mapper.Map <SetupUsersEvent>(setup.UsersSetup); this.publishingRouter.Publish(Queues.Users, usersEvent, null); var accountsEvent = mapper.Map <SetupAccountsEvent>(setup.AccountsSetup); this.publishingRouter.Publish(Queues.Accounts, accountsEvent, null); var cardsEvent = mapper.Map <SetupCardsEvent>(setup.CardsSetup); this.publishingRouter.Publish(Queues.Cards, cardsEvent, null); for (int i = 0; i < setup.LoansSetup.loans.Length; i += 10000) { var portion = setup.LoansSetup.loans.Skip(i).Take(10000).ToArray(); var loansEvent = new SetupAppendLoansEvent { Loans = portion.Select(l => mapper.Map <Loan>(l)).ToArray() }; this.publishingRouter.Publish(Queues.Loans, loansEvent, null); } for (int i = 0; i < setup.PaymentsSetup.payments.Length; i += 10000) { var portion = setup.PaymentsSetup.payments.Skip(i).Take(10000).ToArray(); var paymentsEvent = new SetupAppendPaymentsEvent { Payments = portion.Select(p => mapper.Map <Payment>(p)).ToArray() }; this.publishingRouter.Publish(Queues.Payments, paymentsEvent, null); } for (int i = 0; i < setup.TransactionsSetup.transactions.Length; i += 10000) { var portion = setup.TransactionsSetup.transactions.Skip(i).Take(10000).ToArray(); var transactionsEvent = new SetupAppendTransactionsEvent { Transactions = portion.Select(t => mapper.Map <Transaction>(t)).ToArray() }; this.publishingRouter.Publish(Queues.Transactions, transactionsEvent, null); } return(Task.CompletedTask); }
public Task SetupAppend(MessageContext context, SetupAppendTransactionsEvent inputEvent) { transactionsRepository.SetupAppend(inputEvent.Transactions); return(Task.CompletedTask); }