public ActionResult Details(string accountNumber)
        {
            var currentTradeDate = tradeDateRepository.GetLatestTradeDate();

            var account = this.accountRepository.LoadInvestmentAccount(accountNumber, currentTradeDate);


            var performance = rateOfReturnService.CalculatePerformance(accountNumber);

            var viewModel = new InvestmentAccountDetailsModel()
            {
                TradeDate          = currentTradeDate,
                InvestmentAccount  = account,
                CurrentPerformance = performance.LastOrDefault()
            };

            return(View(viewModel));
        }
예제 #2
0
        public ActionResult Details(string accountNumber)
        {
            logger.LogInformation($"Getting details page for {accountNumber}");
            var currentTradeDate = tradeDateRepository.GetLatestTradeDate();

            var account = this.accountRepository.LoadInvestmentAccount(accountNumber, currentTradeDate);

            var performance = rateOfReturnService.CalculatePerformance(accountNumber);

            var viewModel = new InvestmentAccountDetailsModel()
            {
                TradeDate          = currentTradeDate,
                InvestmentAccount  = account,
                CurrentPerformance = performance.LastOrDefault()
            };

            logger.LogDebug("This message should not show up");

            return(View(viewModel));
        }