//
        // GET: /LoanCalculator/

        public ActionResult Index()
        {
            var viewModel = new LoanRepaymentQueryViewModel();
            viewModel.Title = "Loan Repayment Calculator";

            return View(viewModel);
        }
        public ActionResult Index(LoanRepaymentQueryViewModel loanRepaymentQueryViewModel)
        {
            var loanRequest = new LoanRequest(loanRepaymentQueryViewModel.RepaymentTerm, 
                                              loanRepaymentQueryViewModel.LoanAmount,                
                                              loanRepaymentQueryViewModel.InterestRate);

            loanRepaymentQueryViewModel.MonthlyRepaymentAmount =
                _repaymentCalculator.CalculateMonthlyRepaymentsFor(loanRequest).ToString();
            return View(loanRepaymentQueryViewModel);
        }