public override Task <GetLoansResponse> GetByAccounts(GetLoansRequest request, ServerCallContext context)
        {
            var loans = loansRepository.GetByAccounts(request.Ids)
                        .Select(loan => mapper.Map <Loan>(loan));

            return(Task.FromResult(new GetLoansResponse {
                Loans = { loans }
            }));
        }
Esempio n. 2
0
        public Task GetLoansByAccounts(MessageContext context, GetLoansByAccountsEvent inputEvent)
        {
            var loans = loansRepository.GetByAccounts(inputEvent.AccountsIds);

            publishingRouter.Publish(context.ReplyTo, new SelectedLoansEvent {
                Loans = loans
            }, context.FlowId);
            return(Task.CompletedTask);
        }