public async Task <IActionResult> Index()
        {
            var mortgages = await _mortgageService.GetMortgages();

            var viewModel = new MortgagesViewModel(mortgages);

            return(View(viewModel));
        }
Exemplo n.º 2
0
        public async Task <ActionResult <IEnumerable <Mortgage> > > GetMortgages(long?applicantId, decimal?propertyValue,
                                                                                 decimal?depositValue)
        {
            IEnumerable <Mortgage> mortgages;

            if (applicantId != null && propertyValue != null & depositValue != null)
            {
                mortgages = await _service.GetQualifiedMortgages((long)applicantId, (decimal)propertyValue,
                                                                 (decimal)depositValue);
            }
            else
            {
                mortgages = await _service.GetMortgages();
            }

            return(Ok(mortgages));
        }