public async Task <ActionResult <List <Transaction> > > GetByAccountReceiverId(string accountId) { var query = new GetTransactionsByAccountReceiverIdQuery(accountId); _logger.LogInformation("Get transactions by sender id " + accountId + " request"); return(await _mediator.Send(query)); }
public async Task <List <Transaction> > Handle(GetTransactionsByAccountReceiverIdQuery request, CancellationToken cancellationToken) { using (var scope = _serviceScopeFactory.CreateScope()) { var scopedServices = scope.ServiceProvider; var transactionService = scopedServices.GetRequiredService <TransactionService>(); return(await transactionService.GetByReceiverId(request.AccountId)); } }