public async Task <CustomerInvestments> GetInvestmentsPerCustomer() { var customerInvestments = new CustomerInvestments { Investments = new List <Investment>() }; customerInvestments.Investments.AddRange(await GetLCIInvestments()); customerInvestments.Investments.AddRange(await GetFundsInvestments()); customerInvestments.Investments.AddRange(await GetTreasuryDirectInvestments()); return(customerInvestments); }
public async Task <InvestmentsDetailedViewModel> Get() { CustomerInvestments investments = new CustomerInvestments(); foreach (var service in _externalInvestmentServices) { foreach (var investmentDTO in await service.GetInvestments()) { investments.AddInvestiment(_investmentFactory.Create(investmentDTO)); } } return(_mapper.Map <InvestmentsDetailedViewModel>(investments)); }